Created
August 25, 2016 13:08
-
-
Save danrspencer/3a7c9216df4707e93712854a2cfe663f to your computer and use it in GitHub Desktop.
Setup Git undo alias
This file contains hidden or 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
#!/bin/bash | |
# Credit to: http://megakemp.com/2016/08/25/git-undo/ | |
git config --global alias.undo '!f() { \ | |
git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; \ | |
}; f' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment