In cases like these,you need to do Prostration of Forgiveness.
The prostration of forgetfulness in prayer is generally prescribed for three reasons:
1- Doing something extra
2- Omitting something
3- Being uncertain
Read this link for more details and how to do it.
Reasons for doing the prostration of forgetfulness