Revert Git Revision HOWTO

Remove Files From Git History

I’ve had to revert my Git commits a number of times and to revert git revision involves executing a few commands in a terminal window. To save me time googling for the solution I’ll add it in here for my future reference. To revert your Git repository to a specific revision number you need to do the following:

# reset the index to the desired tree
git reset 56e05fced

# move the branch pointer back to the previous HEAD
git reset --soft [email protected]{1}

git commit -m "Revert to 56e05fced"

# Update working copy to reflect the new commit
git reset --hard

Marko
Reference: Stack Overflow