Sunan an-Nasa'i, Volume 2, Book 13, Hadith 1241 (DarusSalam)

It was narrated from 'Abdullah and attributed to the Prophet: "If one of you is not sure about his prayer, let him estimate what he thinks is most likely to be correct and complete the prayer on that basis, then let him prostrate twice."

أَخْبَرَنَا مُحَمَّدُ بْنُ رَافِعٍ، قَالَ حَدَّثَنَا يَحْيَى بْنُ آدَمَ، قَالَ حَدَّثَنَا مُفَضَّلٌ، - وَهُوَ ابْنُ مُهَلْهَلٍ - عَنْ مَنْصُورٍ، عَنْ إِبْرَاهِيمَ، عَنْ عَلْقَمَةَ، عَنْ عَبْدِ اللَّهِ، يَرْفَعُهُ إِلَى النَّبِيِّ صلى الله عليه وسلم قَالَ ‏ "‏ إِذَا شَكَّ أَحَدُكُمْ فِي صَلاَتِهِ فَلْيَتَحَرَّ الَّذِي يَرَى أَنَّهُ الصَّوَابُ فَيُتِمَّهُ ثُمَّ - يَعْنِي - يَسْجُدُ سَجْدَتَيْنِ ‏" ‏ ‏.‏ وَلَمْ أَفْهَمْ بَعْضَ حُرُوفِهِ كَمَا أَرَدْتُ ‏.‏

sunnah.com