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
Written by Greg van Brug
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#