From Sahih Muslim (Hadith 3040):
Ibn 'Umar reported that Allah's Messenger (ﷺ) used to come out (of Medina) by way of al-Shajarah and entered it by the way of al-Mu'arras and whenever he entered Mecca, he entered it from the upper side and went out of it from the lower side
Reference: Muslim 3040