Skip to content

Instantly share code, notes, and snippets.

@matthiassb
Created January 5, 2015 01:41
Show Gist options
  • Save matthiassb/fe3d9b745afface75fba to your computer and use it in GitHub Desktop.
Save matthiassb/fe3d9b745afface75fba to your computer and use it in GitHub Desktop.
Reset git
git log | perl -n -e '/commit (.*)/ && print "$1\n"' | awk "NR==`git status | grep -Po "(\d) commit" | tr -d [a-z] | xargs -n 1 expr 1 +`" | xargs -n 1 git reset --soft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment