How do I delete unpushed git commits?

Delete the most recent commit, keeping the work you've done:
git reset --soft HEAD~1
Delete the most recent commit, destroying the work you've done:
git reset --hard HEAD~1

How to abort or get rid of merge code in Git ?

git merge --abort

Comments