The World Federation One Stop Fiqh

Ruling 1160

If a person doubts whether or not he performed one of the rukns of prayers, in the event that he has not started to perform the act after it, he must perform it. For example, if before saying tashahhud he doubts whether or not he performed two sajdahs, he must perform them. And in the event that afterwards he remembers that he had performed that rukn, then based on obligatory precaution his prayer is invalid as he will have performed an additional rukn.