Rich Dougherty

Accidental Git commit

I've realised my last post helps when you commit the wrong files or the wrong message, but still want to commit. Sometimes (or quite often for me) you accidentally commit when you're not ready. In that case what you really want is…

git reset --soft HEAD~1

Via Stack Overflow.