To achieve what you're asking you have to execute the command:
git reset --hard <commit-hash>
You can find more infos at the following link:
https://git-scm.com/docs/git-reset#Documentation/git-reset.txt-emgitresetemltmodegtltcommitgt;