how to undo merged commit in git code example Example: recover a merged commit git git checkout -b remerge master git merge branch -s ours