كتاب الْمَسَاجِدِ وَمَوَاضِعِ الصَّلاَةِ
5  
The Book of Mosques and Places of Prayer
(19)
Chapter: As-Sahw (forgetfulness) in prayer and prostrating to compensate for it
(19)
باب السَّهْوِ فِي الصَّلاَةِ وَالسُّجُودِ لَهُ ‏
Sahih Muslim 572 l

'Abdullah (b. Mas'ud) reported:

The Messenger of Allah (ﷺ) said prayer and he omitted or committed (something). Ibrahim (one of the narrators of this hadith) said: It is my doubt, and it was said: Messenger of Allah, has there been any addition to the prayer? He (the Holy Prophet) said: Verily I am a human being like you. I forget just as you forget so when any one of you forgets, he must perform two prostrations, and he (the Holy Prophet) was sitting and then the Messenger of Allah (ﷺ) turned (his face towards the Qibla) and performed two prostrations.
وَحَدَّثَنَا مِنْجَابُ بْنُ الْحَارِثِ التَّمِيمِيُّ، أَخْبَرَنَا ابْنُ مُسْهِرٍ، عَنِ الأَعْمَشِ، عَنْ إِبْرَاهِيمَ، عَنْ عَلْقَمَةَ، عَنْ عَبْدِ اللَّهِ، قَالَ صَلَّى رَسُولُ اللَّهِ صلى الله عليه وسلم فَزَادَ أَوْ نَقَصَ - قَالَ إِبْرَاهِيمُ وَالْوَهْمُ مِنِّي - فَقِيلَ يَا رَسُولَ اللَّهِ أَزِيدَ فِي الصَّلاَةِ شَىْءٌ فَقَالَ ‏ "‏ إِنَّمَا أَنَا بَشَرٌ مِثْلُكُمْ أَنْسَى كَمَا تَنْسَوْنَ فَإِذَا نَسِيَ أَحَدُكُمْ فَلْيَسْجُدْ سَجْدَتَيْنِ وَهُوَ جَالِسٌ ‏"‏ ‏.‏ ثُمَّ تَحَوَّلَ رَسُولُ اللَّهِ صلى الله عليه وسلم فَسَجَدَ سَجْدَتَيْنِ ‏.‏
Reference : Sahih Muslim 572l
In-book reference : Book 5, Hadith 123
USC-MSA web (English) reference : Book 4, Hadith 1179
  (deprecated numbering scheme)