It is narrated from Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) that once the Messenger of Allah (peace and blessings be upon him) forgot something in the prayer, so he performed the two prostrations of forgetfulness (sahw).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2257