Skip to content

Instantly share code, notes, and snippets.

@JeffreyWay
Created August 15, 2013 17:51
Show Gist options
  • Save JeffreyWay/6242988 to your computer and use it in GitHub Desktop.
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.
alias gundo='git reset HEAD~ && git clean -df'
@michaelryancaputo
Copy link

i'm getting a "unknown switch `d'"

@JeffreyWay
Copy link
Author

Hmm - are you using two dashes?

@michaelryancaputo
Copy link

Looks like i'm on version 1.7.12.4, that might be the issue. Copy/pasted directly form your gist.

@nicholasruunu
Copy link

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