Sayyiduna Ubadah bin al-Samit (may Allah be pleased with him) says: The Prophet (peace and blessings be upon him) was asked about a man who becomes forgetful in his prayer and does not know how much he has prayed. The Prophet (peace and blessings be upon him) said: "He should repeat his prayer and, while sitting, perform the two prostrations of forgetfulness."
Al-Tabarani recorded it in this way in al-Mu'jam al-Kabir; the narrator Ishaq did not hear from Sayyiduna Ubadah. And Allah knows best.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الصلاة / 2923