سنن نسائي Sunan an-Nasa'i كتاب السهو The Book of Forgetfulness (In Prayer)
بَابُ : إِتْمَامِ الْمُصَلِّي عَلَى مَا ذَكَرَ إِذَا شَكَّ

Chapter: The praying person completing (the prayer) upon what he remembers when he doubts

2 hadith
Hadith 1239
أَخْبَرَنَا يَحْيَى بْنُ حَبِيبِ بْنِ عَرَبِيٍّ ، قَالَ : حَدَّثَنَا خَالِدٌ ، عَنِ ابْنِ عَجْلَانَ ، عَنْ زَيْدِ بْنِ أَسْلَمَ ، عَنْ عَطَاءِ بْنِ يَسَارٍ ، عَنْ أَبِي سَعِيدٍ ، عَنِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ : " إِذَا شَكَّ أَحَدُكُمْ فِي صَلَاتِهِ فَلْيُلْغِ الشَّكَّ وَلْيَبْنِ عَلَى الْيَقِينِ , فَإِذَا اسْتَيْقَنَ بِالتَّمَامِ فَلْيَسْجُدْ سَجْدَتَيْنِ وَهُوَ قَاعِدٌ , فَإِنْ كَانَ صَلَّى خَمْسًا شَفَعَتَا لَهُ صَلَاتَهُ , وَإِنْ صَلَّى أَرْبَعًا كَانَتَا تَرْغِيمًا لِلشَّيْطَانِ " .
´It was narrated from Abu Sa'eed that:` The Prophet (ﷺ) said: "If one of you is not sure about his prayer, let him forget about what he is unsure of and complete his prayer on the basis of what he is sure of. When he is sure that he has completed it, let him prostrate twice while he is sitting. Then if he has prayed five (rak'ahs), they (the two prostrations) will make his prayer even-numbered, and if he had prayed four, they will annoy and humiliate the shaitan."
Hadith Reference Sunan an-Nasa'i / The Book of Forgetfulness (In Prayer) / Hadith: 1239
Hadith Grading الألبانی: حسن صحيح  |  زبیر علی زئی: صحيح مسلم
Hadith Takhrij «صحیح مسلم/ المساجد 19 (571)، سنن ابی داود/الصلاة 197 (1024)، سنن ابن ماجہ/الإقامة 132 (1210)، موطا امام مالک/الصلاة 16 (62) مرسلاً، حم3/72، 83، 84، 87، سنن الدارمی/الصلاة 174 (1536)، (تحفة الأشراف: 4163)، ویأتي عند المؤلف برقم: 1240 (صحیح)»
Hadith 1240
أَخْبَرَنَا مُحَمَّدُ بْنُ رَافِعٍ ، قَالَ : حَدَّثَنَا حُجَيْنُ بْنُ الْمُثَنَّى ، قَالَ : حَدَّثَنَا عَبْدُ الْعَزِيزِ وَهُوَ ابْنُ أَبِي سَلَمَةَ ، عَنْ زَيْدِ بْنِ أَسْلَمَ ، عَنْ عَطَاءِ بْنِ يَسَارٍ ، عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ ، عَنِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ : " إِذَا لَمْ يَدْرِ أَحَدُكُمْ صَلَّى ثَلَاثًا أَمْ أَرْبَعًا فَلْيُصَلِّ رَكْعَةً ، ثُمَّ يَسْجُدْ بَعْدَ ذَلِكَ سَجْدَتَيْنِ وَهُوَ جَالِسٌ , فَإِنْ كَانَ صَلَّى خَمْسًا شَفَعَتَا لَهُ صَلَاتَهُ , وَإِنْ صَلَّى أَرْبَعًا كَانَتَا تَرْغِيمًا لِلشَّيْطَانِ " .
´It was narrated from Abu Sa'eed Al-Khudri that:` The Prophet (ﷺ) said: "If one of you does not know whether he prayed three or four (rak'ahs), let him pray a rak'ah then prostrate twice after that when he is sitting. Then if he prayed five (rak'ahs), they (the two prostrations) will make his prayer even-numbered, and if he had prayed four, they will annoy and humiliate the shaitan."
Hadith Reference Sunan an-Nasa'i / The Book of Forgetfulness (In Prayer) / Hadith: 1240
Hadith Grading الألبانی: صحيح  |  زبیر علی زئی: إسناده صحيح
Hadith Takhrij «انظر ماقبلہ (صحیح)»