Last Updated: February 25, 2016
·
578
· gregvanbrug

git undo

Sometimes I just want to discard all the changes I've made to a file. Since there's no Command Z, I've made my own. Add this to your .gitconfig as an alias

undo = checkout --

and then undo away

git undo somefile