The World Federation One Stop Fiqh

Ruling 1252

If after going into rukūʿ one remembers that he forgot to perform the two sajdahs in the previous rakʿah, then based on obligatory precaution, his prayer is invalid. However, if he remembers this before going into rukūʿ, he must go back, perform the two sajdahs, stand up, recite Sūrat al-Ḥamd and the other surah or al‐tasbīḥāt al‐arbaʿah, and then complete the prayer. After prayers, based on recommended precaution, he should perform sajdatā al‐sahw for the additional standing.