Forgetting During Prayer (Hadith No. 394)
How many times has it happened to you that you forget the number of raka’at you’ve prayed or how many sujood (prostrations) you’ve done? There’s a simple solution: sajdah sahw.
The Prophet prayed (and the subnarrator Ibrahim said, “I do not know whether he prayed more or less than usual”), and when he had finished the prayers he was asked, “O Allah’s Apostle! Has there been any change in the prayers?” He said, “What is it?’ The people said, “You have prayed so much and so much.” So the Prophet bent his legs, faced the Qibla and performed two prostrations (of Sahw) and finished his prayers with Taslim (by turning his face to right and left saying: ‘As-Salamu’Alaikum-Warahmat-ullah’). When he turned his face to us he said, “If there had been anything changed in the prayer, surely I would have informed you but I am a human being like you and liable to forget like you. So if I forget, remind me and if anyone of you is doubtful about his prayer, he should follow what he thinks to be correct and complete his prayer accordingly and finish it and do two prostrations (of Sahw).”
It’s easy. For example, you’re confused about the number of raka’at you’ve prayed and you’re thinking 2 0r 3? Then go by 2, complete the rest of the prayer accordingly, and prostrate twice at the end of the prayer. That is sajdah sahw.
It’s something all of us should know because we forget a LOT during Salah. If you have any questions, feel free to ask. :)