The Messenger of Allah ﷺ used to go to Quba both riding and on foot.
حدثنا يزيد أخبرنا يحيى بن سعيد عن عبد الله بن دينار
كان رسول الله ﷺ يأتي قباء راكبا وماشيا
Its isnad is sahih, and it is a repetition of 4485.