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