It is narrated from Sayyiduna Ibn Umar (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him), while coming from Makkah to Madinah, would offer (voluntary) prayer on his mount, whichever way he (peace and blessings be upon him) was facing. He (Ibn Umar) said: "It was concerning this that this verse was revealed: 'Wherever you turn, there is Allah' [Surah al-Baqarah: 115]."
(b) It is reported from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that this verse was revealed concerning the obligatory prayer and was later abrogated; and the following report relates to this.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2244