حَدَّثَنَا مُحَمَّدُ بْنُ عَبْدِ اللهِ بْنِ نُمَيْرٍ ، حَدَّثَنَا حَفْصٌ ، عَنْ مِسْعَرٍ ، عَنْ مَنْصُورٍ ، عَنْ إِبْرَاهِيمَ ، عَنْ عَلْقَمَةَ ، عَنْ عَبْدِ اللهِ قَالَ : قَالَ رَسُولُ اللهِ - صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ - : إِذَا شَكَّ أَحَدُكُمْ فَلْيَتَحَرَّ ، وَلْيَسْجُدْ سَجْدَتَيْنِ .
It is narrated from Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "When one of you is in doubt (about the number of rak'ahs or the like in the prayer), he should reflect and try to determine what is correct, and (then complete his prayer accordingly and at the end) perform the two prostrations of forgetfulness."