Sunan an-Nasa'i, Book 13, Hadith 68 (In-Book)

It was narrated that 'Abdullah said: "Whoever has doubt, or is not sure, let him estimate what is correct, then let him prostrate twice."

أَخْبَرَنَا سُوَيْدُ بْنُ نَصْرٍ، قَالَ أَنْبَأَنَا عَبْدُ اللَّهِ، عَنْ مِسْعَرٍ، عَنِ الْحَكَمِ، عَنْ أَبِي وَائِلٍ، عَنْ عَبْدِ اللَّهِ، قَالَ مَنْ شَكَّ أَوْ أَوْهَمَ فَلْيَتَحَرَّ الصَّوَابَ ثُمَّ لْيَسْجُدْ سَجْدَتَيْنِ ‏.‏

sunnah.com