svn revert equivalent in git

I keep wanting to type

git revert

to roll back changes to the last committed version of something—that’s how you’d do it in Subversion—but this isn’t right. This works instead:

git reset --hard HEAD

Leave a Reply