The Messenger of Allah (ﷺ) said: "When any one of you gets up and prays, the Shaitan comes to him an confuses him until he does not know how many (Rak'ahs) he prayed. If any one of you notices that, let him prostrate twice when he is sitting."
Reference: Sunan an-Nasa'i 1252 In-book : Book 13, Hadith 74 English translation : Vol. 2, Book 13, Hadith 1253
Help us gift a modern, ad-free Islamic application for the Muslim Ummah. Your donation will be recorded as Sadaqah Jariyah in your book of deeds, In Sha Allah.