Берешит 40:21 Мидраш: Bereshit Rabbah

וַיָּ֛שֶׁב אֶת־שַׂ֥ר הַמַּשְׁקִ֖ים עַל־מַשְׁקֵ֑הוּ וַיִּתֵּ֥ן הַכּ֖וֹס עַל־כַּ֥ף פַּרְעֹֽה׃

И он вернул главного дворецкого обратно к своему дворецкому; и дал чашу фараону'рука твоя

Bereshit Rabbah

“The chief baker saw that he interpreted well, and he said to Joseph: I too, in my dream, behold, three wicker baskets were on my head” (Genesis 40:16).
“And in the uppermost basket there was all manner of food for Pharaoh, baked products, and the birds were eating them from the basket above my head” (Genesis 40:17).
“Joseph answered and said: This is its interpretation: The three baskets are three days” (Genesis 40:18).
“In three more days Pharaoh shall lift your head from upon you, and shall hang you on a tree, and the birds shall eat your flesh from upon you” (Genesis 40:19).

“The chief baker saw…[and he said to Joseph: I too [af]…]” – Rav Ḥama said: They are four who began with af and were eradicated with wrath [af].12The serpent, the chief baker, the congregation of Koraḥ, and Haman, as explained in Bereshit Rabba 19:2.
“Behold, three wicker baskets” – these are the first three kingdoms.13The first three of the four kingdoms that would subjugate Israel and many other peoples: Babylon, Media, and Greece. “And in the uppermost basket” – this is the fourth kingdom,14Rome. which imposes taxes upon all the nations of the world.
“The birds were eating them” – after they ate [the contents of] the uppermost one, they then ate [the contents of] the lower one. [Joseph] said to him: ‘You gave me bad tidings;15The baker’s dream alluded to the nations that would subjugate Israel. I, too, will give you bad tidings: “In three more days…”’
“It was on the third day, Pharaoh's birthday, he made a feast for all his servants and raised the head of the chief butler and the head of the chief baker among his servants” (Genesis 40:20).
“It was on the third day” – the day of Pharaoh’s birthday celebration.
“He restored the chief butler to his butlership, and he gave the cup into Pharaoh's hand” (Genesis 40:21).
“And he hanged the chief baker, as Joseph interpreted for them” (Genesis 40:22).

“He made a feast…he restored the chief butler…and…the chief baker” – it befell this one what was stated to him and to that one what was stated to him.