The World Federation One Stop Fiqh

Ruling 1256

Whenever after the salām of the prayer one does something that were he to do it intentionally or inadvertently during prayers it would invalidate them – such as turning his back to qibla – and he later remembers that he has not performed the two last sajdahs, his prayer is invalid. However, if he remembers this before doing something that invalidates prayers, he must perform the two sajdahs that he had forgotten and say tashahhud and the salām of the prayer again; and based on obligatory precaution, he must perform sajdatā al‐sahw for the salām that he first said.