If he has fully risen to a standing posture, returning is disliked; if he has not yet stood upright, returning is obligatory. Once he has begun the recitation, however, it becomes unlawful to return, and in every case he must perform the prostration of forgetfulness.
If a worshipper is unsure about the number of rakʿahs he has prayed, he should adopt the lower number. Should he doubt whether he has left out a pillar, he must treat it as omitted, yet he does not prostrate for mere doubt about omitting a wajib or about having added an act.
A congregant performs no sujud sahw except in conformity with his imam, and sujud sahw is obligatory for any inadvertent act whose deliberate counterpart would invalidate the prayer.1
The prayer is nullified by neglecting a sujud sahw whose proper time is only before the closing salām. If he forgets it and says the salām, he may still perform the prostration so long as only a short interval has passed. Two prostrations suffice even when several lapses have occurred.