Abdullah bin Masud reported,

The Messenger of Allah ﷺ led us in prayer and either added something or omitted something. When he gave the closing salam, we said, "Messenger of Allah, has something new occurred in the prayer?"He replied, "If something new had occurred in the prayer, I would have informed you of it. But I am only a Bishr, I forget just as you forget. So whichever of you is uncertain about his prayer, let him consider what is closest to being correct, complete his prayer on that basis, then give the salam and perform two prostrations."

Nasai 1243

Sahih

أخبرنا سويد بن نصر قال أنبأنا عبد الله عن مسعر عن منصور عن إبراهيم عن علقمة

عن عبد الله قال

صلى رسول الله ﷺ فزاد أو نقص فلما سلم قلنا يا رسول الله هل حدث في الصلاة شيء قال لو حدث في الصلاة شيء أنبأتكموه ولكني إنما أنا بشر أنسى كما تنسون فأيكم ما شك في صلاته فلينظر أحرى ذلك إلى الصواب فليتم عليه ثم ليسلم وليسجد سجدتين

النسائي 1243صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Forgetfulness
Chapter
Seeking the most correct direction
Numbering
Darussalam 1243
Nasai 1243