The Messenger of Allah ﷺ offered prayer. The version of the narrator Ibrahim goes: I do not know whether he increased or decreased (the rak'ahs of prayer). When he gave the salutation, he was asked: Has something new happened in the prayer, Messenger of Allah? He said: What is it? They said: You prayed so many and so many (rak'ahs). He then relented his foot and faced the Qiblah and made two prostrations. He then gave the salutation. When he turned away (finished the prayer), he turned his face to us and said: Had anything new happened in prayer, I would have informed you. I am only a human being and I forget just as you do; so when I forget, remind me, and when any of you is in doubt about his prayer he should aim at what is correct, and complete his prayer in that respect, then give the salutation and afterwards made two prostrations.
عَبْدُ اللَّهِ صَلَّى رَسُولُ اللَّهِ ﷺ قَالَ إِبْرَاهِيمُ فَلاَ أَدْرِي زَادَ أَمْ نَقَصَ فَلَمَّا سَلَّمَ قِيلَ لَهُ يَا رَسُولَ اللَّهِ أَحَدَثَ فِي الصَّلاَةِ شَىْءٌ قَالَ وَمَا ذَاكَ قَالُوا صَلَّيْتَ كَذَا وَكَذَا فَثَنَى رِجْلَهُ وَاسْتَقْبَلَ الْقِبْلَةَ فَسَجَدَ بِهِمْ سَجْدَتَيْنِ ثُمَّ سَلَّمَ فَلَمَّا انْفَتَلَ أَقْبَلَ عَلَيْنَا بِوَجْهِهِ ﷺ فَقَالَ إِنَّهُ لَوْ حَدَثَ فِي الصَّلاَةِ شَىْءٌ أَنْبَأْتُكُمْ بِهِ وَلَكِنْ إِنَّمَا أَنَا بَشَرٌ أَنْسَى كَمَا تَنْسَوْنَ فَإِذَا نَسِيتُ فَذَكِّرُونِي وَقَالَ إِذَا شَكَّ أَحَدُكُمْ فِي صَلاَتِهِ فَلْيَتَحَرَّ الصَّوَابَ فَلْيُتِمَّ عَلَيْهِ ثُمَّ لْيُسَلِّمْ ثُمَّ لْيَسْجُدْ سَجْدَتَيْنِ