Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bukhari:6671Isḥāq b. Ibrāhīm > ʿAbd al-ʿAzīz b. ʿAbd al-Ṣamad > Manṣūr > Ibrāhīm > ʿAlqamah > Ibn Masʿūd

that Allah's Prophet led them in the Zuhr prayer and he offered either more or less rakʿat, and it was said to him, "O Messenger of Allah ﷺ ! Has the prayer been reduced, or have you forgotten?" He asked, "What is that?" They said, "You have prayed so many rakʿat." So he performed with them two more prostrations and said, "These two prostrations are to be performed by the person who does not know whether he has prayed more or less (rakʿat) in which case he should seek to follow what is right. And then complete the rest (of the prayer) and perform two extra prostrations."  

البخاري:٦٦٧١حَدَّثَنِي إِسْحَاقُ بْنُ إِبْرَاهِيمَ سَمِعَ عَبْدَ الْعَزِيزِ بْنَ عَبْدِ الصَّمَدِ حَدَّثَنَا مَنْصُورٌ عَنْ إِبْرَاهِيمَ عَنْ عَلْقَمَةَ عَنِ ابْنِ مَسْعُودٍ ؓ

أَنَّ نَبِيَّ اللَّهِ ﷺ صَلَّى بِهِمْ صَلاَةَ الظُّهْرِ فَزَادَ أَوْ نَقَصَ مِنْهَا قَالَ مَنْصُورٌ لاَ أَدْرِي إِبْرَاهِيمُ وَهِمَ أَمْ عَلْقَمَةُ قَالَ قِيلَ يَا رَسُولَ اللَّهِ أَقَصُرَتِ الصَّلاَةُ أَمْ نَسِيتَ قَالَ وَمَا ذَاكَ قَالُوا صَلَّيْتَ كَذَا وَكَذَا قَالَ فَسَجَدَ بِهِمْ سَجْدَتَيْنِ ثُمَّ قَالَ هَاتَانِ السَّجْدَتَانِ لِمَنْ لاَ يَدْرِي زَادَ فِي صَلاَتِهِ أَمْ نَقَصَ فَيَتَحَرَّى الصَّوَابَ فَيُتِمُّ مَا بَقِيَ ثُمَّ يَسْجُدُ سَجْدَتَيْنِ