(2) بَاب قَوْلِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ لَوْلَا الْهِجْرَةُ لَكُنْتُ امْرَأً مِنْ الْأَنْصَارِ
Narrated Abu Huraira:
The Prophet (ﷺ) or Abul-Qasim said, "If the Ansar took their way through a valley or a mountain pass, I would take Ansar's valley. And but for the migration, I would have been one of the Ansar." Abu Huraira used to say, "The Prophet (ﷺ) is not unjust (by saying so). May my parents be sacrificed for him, for the Ansar sheltered and helped him," or said a similar sentence.
Reference: Sahih al-Bukhari 3779
In-book reference: Book 63, Hadith 4
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 5, Book 58, Hadith 123