The Messenger of Allah ﷺ would pray on his mount as he traveled from Makkah to Madinah, facing whatever direction it was headed. He said, and it was concerning this that the verse was revealed, "So wherever you turn, there is the face of Allah" [Baqarah 2:115].
كان رسول الله ﷺ يصلي وهو مقبل من مكة إلى المدينة على راحلته حيث كان وجهه، قال: وفيه نزلت {فأينما تولوا فثم وجه الله} [سورة البقرة: ١١٥].