Skip to content

Instantly share code, notes, and snippets.

@nclark
Created February 26, 2010 05:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nclark/315428 to your computer and use it in GitHub Desktop.
Save nclark/315428 to your computer and use it in GitHub Desktop.
git fuckit --hard
#!/bin/bash
if [ "$1" == "--hard" ]; then
git add .
git reset --hard
else
git add .
git commit -a -m 'FUCK' > /dev/null
git reset HEAD^
git add .
git reset --hard > /dev/null
sha=`git reflog | head -2 | tail -1 | cut -d" " -f1`
echo "buried as $sha in your reflog"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment