Joseph came into contact with a known wormhole, namely Hebron (Genesis 37:14). Wrinkles in space-time are known to exist in Hebron: Numbers 13:22 tells us that Hebron was built seven years before Zoan of Egypt. Rashi comments that it's impossible for Hebron to have been built before Zoan, but because Hebron is seven times as beautiful as Zoan, the Torah says it was built seven years before Zoan.
From this we can derive the Beauty-Time Theorem: Beautiful things are sent into the past, while ugly things are sent into the future.1
After he was sent from the Hebron Wormhole, Joseph got lost (Genesis 37:15), no doubt in a time warp. Now, since Joseph was beautiful or form and figure (Genesis 39:6), so much so that girls climbed walls to look at him (Genesis 49:22), any time warp would have taken him very far into the past. Joseph was used to this by now, and he could usually just get back by asking people what the year was.
However, the year of the Flood posed a special problem, because there is a dispute (Zevachim 113a) whether Israel was affected by the flood. Since both opinions are correct, Joseph was simultaneously being rained on and not being rained on.
Luckily for Joseph, he happened to have a box with a dove in it. He knew that if the Flood affected Israel, the bird would have already died; but if it didn't, the bird would be alive. Since the Flood both happened and didn't happen, the bird in the box was simultaneously alive and dead. Therefore, וַיֹּ֛סֶף שַׁלַּ֥ח אֶת־הַיּוֹנָ֖ה מִן־הַתֵּבָֽה: Joseph sent the dove out of the box to force one of the possibilities to be true. Once the paradox was disposed of, he was able to return to his own time.
1 Thus, for instance, the stay in Egypt was supposed to be 400 years long (Genesis 15:13), but the Holy One Blessed Is He calculated the yuck factor (חִשַּׁב אֶת־הַקֵּץ, as in קַצְתִּי בְחַיַּי) and sent us 190 years into the future (rolling around in your blood alone is worth at least half a century of ugliness!).