undo a git merge

C++
git reset --hard HEAD~1
git reset --hard <commit_sha>git reset --hard HEAD~1

Source

Also in C++: