[Machine] I heard from the Messenger of Allah ﷺ or from one of his companions what he mentioned that the Messenger of Allah ﷺ commanded when a person makes a mistake in their prayer. I asked: "Have you heard anything about this, O Amir al-Mumineen?" He replied: "No." Then Abdullah ibn Awf entered upon us and asked: "What are you discussing?" Umar said: "I asked him if he heard the Messenger of Allah ﷺ or any of his companions mention what the Messenger of Allah ﷺ commanded when a person makes a mistake in their prayer." Abdullah ibn Awf said: "I have knowledge of that." Umar said: "Come forth and narrate, for you are the just and trustworthy." Abdullah ibn Awf said: "I heard the Messenger of Allah ﷺ say, 'If one of you is uncertain between two scenarios [in prayer], then they should choose the one that is less in number. And if one is uncertain between two scenarios and a third, they should choose the two. And if one is uncertain between three scenarios and four, they should choose the three. Then they should complete what remains of their prayer until the doubt only pertains to the extra [acts of worship]. Then they should prostrate twice while sitting before completing their prayer.'"
سَمِعْتَ مِنْ رَسُولِ اللَّهِ ﷺ أَوْ مِنْ أَحَدٍ مِنْ أَصْحَابِهِ مَا يَذْكُرُ مَا أَمَرَ بِهِ رَسُولُ اللَّهِ ﷺ إِذَا سَهَا الْمَرْءُ فِي صَلَاتِهِ؟ قُلْتُ لَا أَوَمَا سَمِعْتَ يَا أَمِيرَ الْمُؤْمِنِينَ؟ قَالَ لَا فَدَخَلَ عَلَيْنَا عَبْدُ الرَّحْمَنِ بْنُ عَوْفٍ فَقَالَ فِيمَا أَنْتُمَا؟ فَقَالَ عُمَرُ سَأَلْتُهُ هَلْ سَمِعَ رَسُولَ اللَّهِ ﷺ أَوْ مِنْ أَحَدٍ مِنْ أَصْحَابِهِ يَذْكُرُ مَا أَمَرَ بِهِ رَسُولُ اللَّهِ ﷺ إِذَا سَهَا الْمَرْءُ فِي صَلَاتِهِ فَقَالَ عَبْدُ الرَّحْمَنِ عِنْدِي عِلْمٌ مِنْ ذَلِكَ فَقَالَ عُمَرُ هَلُمَّ فَأَنْتَ الْعَدْلُ الرِّضَا فَقَالَ عَبْدُ الرَّحْمَنِ سَمِعْتُ رَسُولَ اللَّهِ ﷺ يَقُولُ «إِذَا شَكَّ أَحَدُكُمْ فِي الِاثْنَتَيْنِ فَلْيَجْعَلْهُمَا وَاحِدَةً وَإِذَا شَكَّ فِي الِاثْنَتَيْنِ وَالثَّلَاثِ فَلْيَجْعَلْهُمَا اثْنَتَيْنِ وَإِذَا شَكَّ فِي الثَّلَاثِ وَالْأَرْبَعِ فَلْيَجْعَلْهُمَا ثَلَاثًا ثُمَّ يُتِمُّ مَا بَقِيَ مِنْ صَلَاتِهِ حَتَّى يَكُونَ الْوَهْمُ فِي الزِّيَادَةِ ثُمَّ يَسْجُدُ سَجْدَتَيْنِ وَهُوَ جَالِسٌ قَبْلَ أَنْ يُسَلِّمَ»