[Machine] The Prophet ﷺ said, "If anyone of you has doubts about his prayer, he should cast aside the doubt and be certain about it, and then offer two prostrations (sajdahs). If he prayed five obligatory prayers, by offering these two prostrations, they will complete them. However, if he prayed four sunnah prayers, they will be an admonition to the devil."
قَالَ النَّبِيُّ ﷺ إِذَا شَكَّ أَحَدُكُمْ فِي صَلَاتِهِ فَلْيُلْقِ الشَّكَّ وَلْيَبْنِ عَلَى الْيَقِينِ وَلْيُصَلِّ سَجْدَتَيْنِ فَإِنْ كَانَتْ خَمْسًا شَفَعَ بِهِمَا وَإِنْ كَانَ صَلَّى َأَرْبَعًا كَانَتَا تَرْغِيمًا لِلشَّيْطَانِ