Sunnah.com reference : Book 2, Hadith 234English translation : Book 2, Hadith 330Arabic reference : Book 2, Hadith 335
Narrated Ibn Mas'ud (RA):
Allah's Messenger (ﷺ) offered prayer and when he said Taslim (salutation), he was asked, "O Allah's Messenger! Has something new happened to the Salat (prayer)?" He asked, "What is that?" They said, "You have prayed so many and so many (Rak'at)." He [Ibn Mas'ud (RA)] said, "He then bent his legs, faced the Qiblab, and made two prostrations and then said the Taslim (salutations). Then he faced us and said, "If something new is introduced to the Salat (prayer), I shall inform you but I am a human being like you, I forget just as you forget; so if I forget remind me and if any of you is in doubt about his Salat (prayer) he should act upon what he thinks is correct and complete his prayer in that  respect and then he should make two prostrations."

[Agreed upon].
وَعَنِ ابْنِ مَسْعُودٍ ‏- رضى الله عنه ‏- قَالَ : { صَلَّى رَسُولُ اَللَّهِ ‏- صلى الله عليه وسلم ‏-فَلَمَّا سَلَّمَ قِيلَ لَهُ : يَا رَسُولَ اَللَّهِ , أَحَدَثَ فِي اَلصَّلَاةِ شَيْءٌ ? قَالَ : " وَمَا ذَلِكَ ? " .‏  1‏ قَالُوا : صَلَّيْتَ كَذَا , قَالَ : فَثَنَى رِجْلَيْهِ وَاسْتَقْبَلَ اَلْقِبْلَةَ , فَسَجَدَ سَجْدَتَيْنِ , ثُمَّ سَلَّمَ , ثُمَّ أَقْبَلَ عَلَيْنَا بِوَجْهِهِ فَقَالَ : " إِنَّهُ لَوْ حَدَثَ فِي اَلصَّلَاةِ شَيْءٌ أَنْبَأْتُكُمْ بِهِ , وَلَكِنْ إِنَّمَا أَنَا بَشَرٌ أَنْسَى كَمَا تَنْسَوْنَ , فَإِذَا نَسِيتُ فَذَكِّرُونِي , وَإِذَا شَكَّ أَحَدُكُمْ فِي صَلَاتِهِ فَلْيَتَحَرَّ اَلصَّوَابَ , فلْيُتِمَّ عَلَيْهِ , ثُمَّ لِيَسْجُدْ سَجْدَتَيْنِ }  مُتَّفَقٌ عَلَيْهِ .‏  2‏‏1 ‏- كذا بالأصلين وفي " الصحيحين " : " وما ذاك " .‏‏2 ‏- صحيح .‏ رواه البخاري (401)‏ ، ومسلم ( 572 )‏ ، واللفظ لمسلم ، إذ في البخاري زيادة : " ثم ليسلم " وهو ما اعتبره الحافظ رواية للبخاري .‏