how to uncommit in git

C++
git reset --soft HEAD^

git reset HEAD^
//And if you actually want to completely undo it, throwing away all uncommitted changes, resetting everything to the previous commit (as the original question asked):

git reset --hard HEAD^git reset --soft HEAD^

Source

Also in C++: