The Prophet ﷺ said, "I saw in a dream that I was migrating from Makkah to a land containing palm trees. My thoughts went to it being Yamamah or Hajar, but it turned out to be Madinah, Yathrib.In this dream of mine, I also saw that I brandished a sword and its blade broke, and that turned out to be the loss suffered among the believers on the day of Uhud. Then I brandished it again and it returned better than it had been before, and that turned out to be the victory Allah brought about and the gathering of the believers.I also saw in it cattle, and by Allah, it is good. They turned out to be the group of believers on the day of Uhud, and the good is what Allah brought of goodness afterward, and the reward of truthfulness that Allah granted us after the day of Badr."
عن النبي ﷺ قال: رأيت في المنام أني أ أهاجر من مكة إلى أرض بها نخل، فذهب وهلي إلى أنها اليمامة أو هجر، فإذا هي المدينة يثرب، ورأيت في رؤياي هذه أني هززت سيفا، فانقطع صدره، فإذا هو ما أصيب من المؤمنين يوم أحد، ثم هززته أخرى، فعاد أحسن ما كان، فإذا هو ما جاء الله به من الفتح، واجتماع المؤمنين. ورأيت فيها أيضا بقرا والله خير، فإذا هم النفر من المؤمنين يوم أحد، وإذا الخير ما جاء الله به من الخير بعد، وثواب الصدق الذي آتانا الله بعد يوم بدر.
Bukhari narrated it in the Book of Virtues (3622), and Muslim narrated it in the Book of Dreams (2272), both of them from Muhammad bin Ala, who said, Hammad bin Usama narrated to us, from Burayd bin Abdullah bin Abu Burda, from his grandfather Abu Burda, from Abu Musa, and he mentioned it.