Let's say I am merging and just before the push I decide that I do not want to merge. Is it possible to get rid of the commits I have merged (and not pushed yet) without deleting my local branch or going into command line?


Happened to me while getting both push and pull failures:

  • "Push to origin/master was rejected"
  • "You have not concluded your merge (MERGE_HEAD exists). Please, commit your changes before you can merge"

To resolve:

  1. Go to "Version Control" window --> "Log" tab.
  2. Right click the previous commit --> "Reset Current Branch to Here..."
  3. In Git reset select "Mixed" (it keeps local changes).
  4. If there are later commits that were already pushed --> Pull from remote and merge as required.
  5. Commit the new changes, and Push to remote.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.