re: and the second top voted question on StackOverflow is... VIEW POST

FULL DISCUSSION
 

My solution, been using it for years

alias undo_commit git reset HEAD~ --soft && git reset HEAD

code of conduct - report abuse