Hadith Q1031

ثُمَّ ذُكِّرَ بِتَسْبِيحٍ أَنَّهُ نَاسٍ لِلْجُلُوسِ، أَنَّ عَلَيْهِ الْمُضِيَّ فِي صَلَاتِهِ، تَرْكَ الرُّكُوعِ إِلَى الْجُلُوسِ، وَعَلَيْهِ سَجْدَتَا السَّهْوِ قَبْلَ السَّلَامِ
Then he should be alerted by saying "Subhanallah" that he forgot to sit for Tashahhud, so he should continue his prayer and, after standing up, should not sit down again, and before saying the Salam, he should perform two prostrations.
Hadith Reference صحيح ابن خزيمه / جماع أبواب السهو فى الصلاة / Q1031