git log
 to check the commit list.
For example, commit 7f6d03 was before the 2 wrongful commits and we want to restore to that commit .
Force push that commit as the new master:
git push origin +7f6d03:master
The + is interpreted as forced push.
Another way
You can also use git reset to undo things. Then force push.
git reset 7f6d03 –hard
git push origin -f