Skip to content

Instantly share code, notes, and snippets.

@KlausTrainer
Created March 22, 2011 11:50
Show Gist options
  • Save KlausTrainer/881107 to your computer and use it in GitHub Desktop.
Save KlausTrainer/881107 to your computer and use it in GitHub Desktop.
recover lost git commits
for i in `git fsck --full | grep "dangling commit" | head | grep -o -E "[0-9a-f]+$"`; do git show $i | vim -; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment