"When one of you becomes forgetful in his Salat so that he does not know if he prayed one or two, then let him consider it one. When he does not know if he prayed three or four, then let him consider it three, and let him perform two prostrations before he says the Taslim." (Using translation from Tirmidhī 398)
"إِذَا سَهَا أحدُكم في صلاتِه فلم يدرِ واحدةً صلى أوْ ثنتْين؟ فْلَيَبْنِ علَى واحدةٍ، فإِنْ لمْ يدرِ ثلاثًا صلّى أو أرْبعًا؟ فليبْنِ على ثلاثٍ، ولْيَسجدْ سجدتين قبلَ أنْ يُسلِّمَ".