Find Your Target Commit
One of ways to reset a commit is to find the target commit Id.
Target commit Id can be found e.g. by executing git log
command.
Output will have format of
commit <commit Id>
Author: <author>
Date: <date>
<commit message>
...
Reset Local Repository
Once the target commit Id has been found, execute following command
--hard
option is given to reset also working tree changes.
By now your local repository head is reset to the exact state as it was at the time of your target commit.
Reflect Local Reset On Remote
To reflect your local changes on remote branch, execute following command
--force
option is given to allow update remote ref even when it is not an ancestor of local ref.
Both your local and remote branch states are now set to the state of the given past target commit.
Closing Notes
Additional documentation can be found at
https://www.git-scm.com/docs/git-log
https://www.git-scm.com/docs/git-reset
https://www.git-scm.com/docs/git-push