(Imām Bukhārī narrates): Yahya bin Bukair narrated the hadith to us, he said: Laith narrated the hadith to us, from Uqail, from Ibn Shihab, from Abdullah bin Amir bin Rabi'ah, that Hazrat Amir bin Rabi'ah (Allāh be pleased with him) informed him that
I saw the Messenger of Allāh ﷺ offering prayer upon his mount by the gesture of his head, whichever way the mount was facing, and the Prophet ﷺ did not do this in the obligatory prayer.
Reference: Sahih Al Bukhari 1097