Sahih al-Bukhari — Accepting Information Given by a Truthful Person — Hadith No: 7251
Translation
Narrated `Abdullah bin `Umar:While the people were at Quba offering the morning prayer, suddenly a person came to them saying, "Tonight Divine Inspiration has been revealed to Allah's Messenger (ﷺ) and he has been ordered to face the Ka`ba (in prayers): therefore you people should face it." There faces were towards Sham, so they turned their faces towards the Ka`ba (at Mecca)