Git reset to previous commit

Since your commits are pushed remotely you need to remove them. I'll assume your branch is master and it's pushed over origin.

You first need to remove master from origin:

git push origin :master (note the colon)

Then you need to get master to the status you want, I'll assume the commit hash is ABCDE:

git reset --hard ABCDE

Lastly, push master again:

git push origin master

That's it! Note that if someone already downloaded your changes from origin this will screw them pretty much leaving their local repos unstable.


Find the commit you want to reset to:

git log

Once you have the hash:

git reset --hard <hash>

And to push onto the remote:

git push -f <remote> <branch>

Tags:

Git