When a fifth rakah is mistakenly begun in a four-rakah fard, determine two facts: was the required final sitting completed after the fourth, and has the fifth’s prostration already happened?
Those two facts decide whether to return to sitting, complete two added voluntary rakahs, or repeat the fard due to invalidity.