Sahih al-Bukhari, Book 94, Hadith 20 (Bukhari 6971)
Narrated `Abdullah bin Zaid:
The Prophet (ﷺ) said, "But for the emigration, I would have been one of the Ansar; and if the people took their way in a valley (or a mountain pass), I would take Ansar's valley or their mountain pass."