Abu Musa Ashari reported,

I think this is from the Prophet ﷺ, who said, "I saw in a dream that I was migrating from Makkah to a land with date palms. My mind went to the thought that it was Yamamah or Hajar, but it turned out to be Madinah, Yathrib. I also saw cattle in the dream, and Allah is best. They turned out to be the believers on the day of Uhud, and the good was the good that Allah brought, and the reward of truthfulness that Allah granted us after the day of Badr."

Bukhari 7035

Sahih

حدثني محمد بن العلاء حدثنا أبو أسامة عن بريد عن جده أبي بردة

عن أبي موسى

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

البخاري 7035صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Dream interpretation
Chapter
When one sees cows being slaughtered
Numbering
Darussalam 7035
Bukhari 7035