Prophet Yusuf meets his brothers
As Prophet Yusuf (alayhis salam) had predicted, seven years of famine followed seven years of good harvest, but the storehouses of Egypt were full because of Prophet Yusuf's skillful management. People from all over flocked to Egypt to buy grain during the famine. Among them were Prophet Yusuf's (alayhis salam) brothers.
Prophet Yusuf (alayhis salam) knew his brothers at once but they did not recognize him. He gave them the grain which they had come to buy but warned them that they would get no more unless they brought a brother of theirs to him from their father. They agreed that they would try to convince their father to let them take their younger brother with them the next time they came. Then Prophet Yusuf (alayhis salam) had his servants put their money which they had used to purchase the grain back into the saddlebags of their camels so that they would find it when they returned home and would be sure to return for more grain when they saw how generously Prophet Yusuf (alayhis salam) had treated them.
Ya'qub (alayhis salam), who still felt deeply the loss of his son Prophet Yusuf (alayhis salam), was reluctant to let the brothers take his other young son. He made them pledge in the name of Allah that they would bring him back home unless they were made physically powerless to do so. He also cautioned them to enter the city in Egypt by different gates, perhaps so they wouldn't look like a gang of troublemakers. However, he knew that their fate depended on Allah's will and no precautions could go against what was willed by Allah.
When the brothers had returned to Prophet Yusuf (alayhis salam) for more provisions, Prophet Yusuf (alayhis salam) lodged his younger brother with himself, and revealed his identity to him. But he had to think of a way in which to keep his younger brother with him when the others returned home. Allah inspired him with the following plan.
When the brothers' camels had been loaded with grain, Prophet Yusuf (alayhis salam) had a cup placed in his younger brother's saddlebag. Then a cry was raised that someone had stolen the king's cup. The brothers denied that they had stolen anything. When asked what should happen if it were to prove otherwise, they said that they would hand over the person in whose possession the cup was found. A search of the saddlebags revealed the cup in the younger brother's bag. Then the big brothers said that it wasn't really surprising, because the boy's brother (i.e. Prophet Yusuf (alayhis salam)) had also been a thief. But still Prophet Yusuf (alayhis salam) did not reveal his identity to them. The brothers asked that one of them be allowed to stay in the younger brother's place, so that their father would not grieve, but Prophet Yusuf (alayhis salam) replied that it would be unjust to keep back anyone except him in whose possession the cup had been.
The brothers returned to their father with the story of the theft, and his eyes turned white with grief from suppressing his sorrow. He sent them away to search for Prophet Yusuf (alayhis salam) and his brother, so they returned to Prophet Yusuf (alayhis salam) and asked for more grain, although they had but little money left. Then Prophet Yusuf (alayhis salam) revealed his identity to them and forgave them and asked Allah's forgiveness for all the wrong they had done to him and his brother. Then he gave them his shirt to place over his father's face to recover his sight. He told them to go home and return to Egypt with all of their families.
Prophet Yusuf reunited with his family
As their caravan was leaving Egypt, Ya'qub (alayhis salam), still at home, smelled the perfume of Prophet Yusuf (alayhis salam), but his household said he was getting senile. When the caravan arrived home with the shirt, Ya'qub's (alayhis salam) sight was restored. Then the entire family moved to Egypt. Prophet Yusuf (alayhis salam) raised his parents up on the throne to sit with him and they all bowed down in obedience to him. In this way, Prophet Yusuf's (alayhis salam) childhood vision of the eleven planets and the sun and the moon prostrating themselves before him came true. This is how the Israelites came to settle in Egypt and lived there for many generations. The entire story of Prophet Yusuf (alayhis salam) can be found in Surah 12 of the Qur'an.
source: Haqq Islam