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