Created
August 15, 2013 17:51
-
-
Save JeffreyWay/6242988 to your computer and use it in GitHub Desktop.
Ever want to undo everything that you've worked on since the last commit (including adding new files)? Here's a little alias to help with that.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias gundo='git reset HEAD~ && git clean -df' |
Yeah
Thats awesome, mainly because I had no idea you could add aliases in your .gitconfig
, not a file I really touch. cheers @zackkitzmiller
i'm getting a "unknown switch `d'"
Hmm - are you using two dashes?
Looks like i'm on version 1.7.12.4, that might be the issue. Copy/pasted directly form your gist.
This might be kind of relevant:
# Undo a `git push`
undopush = push -f origin HEAD^:master
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think this would be better in
.gitconfig
usage:
$ git undo