The Prophet ﷺ said, "In a dream I saw myself migrating from Mecca to a place having plenty of date trees. I thought that it was Al-Yamama or Hajar, but it came to be Medina i.e. Yathrib. In the same dream I saw myself moving a sword and its blade got broken. It came to symbolize the defeat which the Muslims suffered from, on the Day of Uhud. I moved the sword again, and it became normal as before, and that was the symbol of the victory Allah bestowed upon Muslims and their gathering together. I saw cows in my dream, and by Allah, that was a blessing, and they symbolized the believers on the Day of Uhud. And the blessing was the good Allah bestowed upon us and the reward of true belief which Allah gave us after the day of Badr. (Using translation from Bukhārī 3622)
عَنِ النَّبِيِّ ﷺ قَالَ «رَأَيْتُ فِي الْمَنَامِ أَنِّي أُهَاجِرُ إِلَى أَرْضٍ بِهَا نَخْلٌ فَذَهَبَ وَهَلِي أَنَّهَا الْيَمَامَةَ أَوْ هَجَرُ فَإِذَا هِيَ الْمَدِينَةُ يَثْرِبُ وَرَأَيْتُ فِي رُؤْيَايَ هَذِهِ أَنِّي هَزَزْتُ سَيْفًا فَانْقَطَعَ صَدْرُهُ فَإِذَا هُوَ مَا أُصِيبَ مِنَ الْمُؤْمِنِينَ يَوْمَ أُحدٍ ثُمَّ هَزَزْتُهُ بِأُخْرَى فَعَادَ أَحْسَنَ مَا كَانَ فَإِذَا هُوَ مَا جَاءَ اللهُ بِهِ مِنَ الْفَتْحِ وَاجْتِمَاعِ الْمُؤْمِنِينَ وَرَأَيْتُ فِيهَا بَقَرًا وَاللهُ خَيْرٌ فَإِذَا هُمُ النَّفَرُ مِنَ الْمُؤْمِنِينَ يَوْمَ أُحُدٍ وَإِذَا الْخَيْرُ مَا جَاءَنَا اللهُ بِهِ مِنَ الْخَيْرِ بَعْدُ وَثَوَابُ الصِّدْقِ الَّذِي كَانَ بَعْدَ يَوْمِ بَدْرٍ»