Abu Musa Ashari reported,

The Prophet ﷺ said, "I saw in a dream that I was emigrating from Mecca to a land with palm trees. My thought went to it being Yamamah or Hajar, but it turned out to be Madinah, Yathrib.In this dream of mine, I shook a sword and its blade broke off. That turned out to be the loss suffered by the believers on the day of Uhud. Then I shook it again, and it returned to a better state than before. That turned out to be the victory Allah brought about and the gathering together of the believers.I also saw cattle in the dream, and Allah is good. They turned out to be the believers on the day of Uhud, and the good was the good that Allah brought and the reward for truthfulness that Allah granted us after the day of Badr."

Azami 8811

Sahih

عن أبي موس

ى، عن النبي ﷺ قال: رأيت في المنام، أني أهاجر من مكة إلى أرض بها نخل، فذهب وهلي إلى أنها اليمامة، أو هجر، فإذا هي المدينة يثرب، ورأيت في رؤياي هذه أني هززت سيفا فانقطع صدره، فإذا هو ما أصيب من المؤمنين يوم أحد، ثم هززته بأخرى فعاد بأحسن ما كان، فإذا هو ما جاء الله به من الفتح واجتماع المؤمنين، ورأيت فيها بقرا، والله خير، فإذا هم المؤمنون يوم أحد، وإذا الخير ما جاء الله من الخير وثواب الصدق الذي أتانا الله بعد يوم بدر.

الأعظمي 8811صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Biography of the Prophet ﷺ
Chapter
Uhud expedition
Section
Prophet's consultation about departing from Madinah to confront the enemy in defense of the people of Madinah
Numbering
Jami al-Kamil 8811 (2nd edition)
Azami 8811