git remove commit before push

C++
# Removes latest commit from the stash, KEEPS changes
git reset --soft HEAD~

# Removes latest commit from the stash, DELETES changes
git reset --hard HEAD~git reset HEAD~1git reset --soft HEAD~
Source

Also in C++: