It is narrated from Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: "When one of you has a doubt in his prayer, let him seek out what he considers to be correct, then complete it, then perform two prostrations."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 9791