Bookmark, Git, Software.

Separate an accidentally amended commit again.

$ git add -p
[...hack hack hack...]
$ git commit --amend
# oops! intended git commit rather than git commit --amend;
$ git stash (optional)
$ s=$(git rev-parse HEAD)
$ git reset --hard HEAD@{1}
$ git cherry-pick -e $s

Posted 2016-03-08 21:03 / link