Genesis 40:1-23 NIV
Some time later, the cupbearer and the baker of the king of Egypt offended their master, the king of Egypt. Pharaoh was angry with his two officials, the chief cupbearer and the chief baker, and put them in custody in the house of the captain of the guard, in the same prison where Joseph was confined. The captain of the guard assigned them to Joseph, and he attended them.
After they had been in custody for some time, each of the two men—the cupbearer and the baker of the king of Egypt, who were being held in prison—had a dream the same night, and each dream had a meaning of its own.
When Joseph came to them the next morning, he saw that they were dejected. So he asked Pharaoh’s officials who were in custody with him in his master’s house, “Why do you look so sad today?”
“We both had dreams,” they answered, “but there is no one to interpret them.”
Then Joseph said to them, “Do not interpretations belong to God? Tell me your dreams.”
So the chief cupbearer told Joseph his dream. He said to him, “In my dream I saw a vine in front of me, and on the vine were three branches. As soon as it budded, it blossomed, and its clusters ripened into grapes. Pharaoh’s cup was in my hand, and I took the grapes, squeezed them into Pharaoh’s cup and put the cup in his hand.”
“This is what it means,” Joseph said to him. “The three branches are three days. Within three days Pharaoh will lift up your head and restore you to your position, and you will put Pharaoh’s cup in his hand, just as you used to do when you were his cupbearer. But when all goes well with you, remember me and show me kindness; mention me to Pharaoh and get me out of this prison. I was forcibly carried off from the land of the Hebrews, and even here I have done nothing to deserve being put in a dungeon.”
When the chief baker saw that Joseph had given a favorable interpretation, he said to Joseph, “I too had a dream: On my head were three baskets of bread. In the top basket were all kinds of baked goods for Pharaoh, but the birds were eating them out of the basket on my head.”
“This is what it means,” Joseph said. “The three baskets are three days. Within three days Pharaoh will lift off your head and impale your body on a pole. And the birds will eat away your flesh.”
Now the third day was Pharaoh’s birthday, and he gave a feast for all his officials. He lifted up the heads of the chief cupbearer and the chief baker in the presence of his officials: He restored the chief cupbearer to his position, so that he once again put the cup into Pharaoh’s hand— but he impaled the chief baker, just as Joseph had said to them in his interpretation.
The chief cupbearer, however, did not remember Joseph; he forgot him.
NIV: New International Version