Abdullah said, "The Messenger of Allah ﷺ led us in prayer."Ibrahim said, "I do not know whether he added or omitted something."When he gave the salam, it was said to him, "Messenger of Allah, has something new occurred in the prayer?"He asked, "What is that?"They replied, "You prayed in such and such a way."So he turned his leg, faced the qiblah, and performed two prostrations with them, then gave the salam. When he turned, he faced us with his face ﷺ and said, "If anything new had occurred in the prayer, I would have informed you of it. But I am only a human being. I forget as you forget, so when I forget, remind me."He also said, "When one of you is uncertain about his prayer, let him seek what is correct, complete his prayer accordingly, then give the salam, then perform two prostrations."
حدثنا عثمان بن أبي شيبة حدثنا جرير عن منصور عن إبراهيم
قال عبد الله صلى رسول الله ﷺ قال إبراهيم فلا أدري زاد أم نقص فلما سلم قيل له يا رسول الله أحدث في الصلاة شيء قال وما ذاك قالوا صليت كذا وكذا فثنى رجله واستقبل القبلة فسجد بهم سجدتين ثم سلم فلما انفتل أقبل علينا بوجهه ﷺ فقال إنه لو حدث في الصلاة شيء أنبأتكم به ولكن إنما أنا بشر أنسى كما تنسون فإذا نسيت فذكروني وقال إذا شك أحدكم في صلاته فليتحر الصواب فليتم عليه ثم ليسلم ثم ليسجد سجدتين
Bukhari narrated it, in the chapter on Prayer, section on facing the qibla wherever one may be, hadith no. 401, and Muslim also narrated it, hadith no. 572, from Uthman bin Abu Shayba, with the same chain.