cancel commit before push

Shell
git reset HEAD~1
Source

Also in Shell: