It is narrated from Sayyiduna al-Mughirah bin Shu'bah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "If the imam forgets (in the prayer) and stands up fully, then he must perform the two prostrations of forgetfulness; and if he has not stood up fully, then there is no prostration of forgetfulness upon him."
Hadith Referenceالمعجم الكبير للطبراني / باب الميم / 18071