The World Federation One Stop Fiqh

Ruling 1028

If after one’s forehead touches the ground he remembers that he did not perform rukūʿ, it is necessary that he stand up and perform rukūʿ. In case he remembers in the second sajdah, his prayer is invalid based on obligatory precaution.