If you are like me and you fork some project, make a bunch of changes and commit to your local and remote repositories only to discover that you pushed changes that should not go in.
Then here is a quick way to undo to a specific commit locally and then push that to the remote branch.
Keep in my mind that by doing this you will lose your local work (i.e. the work you want to undo) so only do this if you don't care about the work you did before you pushed the new commit.
First, find out the commit SHA you want to reset to. In Github you can get this like so:
|Grab the SHA of the commit to want to go back to|
In you command line run these commands one by one.
git reset --hard 0415b7a2bf2517f37f662e063ffee36706554d8f git push --force
The reset syntax is basically:
git reset --hard target-commit-SHA (grab the full SHA by clicking the link in green above)
Your repos (local and remote) should now have gone back to the point you wanted it to.
Use at your own risk!! :)