In PyCharm I got an error like while trying to pull latest changes:

You have not concluded your merge (MERGE_HEAD exists).

I was checking the version control tab but there wasn't anything suspicious at first sight. Then I try it to inspect logs in version control and I found strange uncompleted commit.

I decided to see what will happen if a revert all changes or move them to another list - but this didn't help with the git pull. I wasn't able to change the branch because of this error too.

So finally I decided to try to do a push and check what is going to happen. The failed commit was loaded and prepared for push. The problem was that this commit was outdated and not for push.

PyCharm suggested me to do a merge of the pull request and my changes. This solution wasn't working - because I didn't want to change code of other people - I wanted just to check the latest changes in this project.

In order to solve the problem I needed to:

  1. PyCharm
  2. Open the version control tab - ALT + 9
  3. Check local changes
  4. Open PyCharm terminal - ALT + F12
  5. Undo the merge by typing
git merge --abort
  1. Pull the changes
  2. Resolve conflicts
  3. Commit and push code (if anything)

As a last resort in case that previous solution is not working you can try to do:

rm -rf .git/MERGE*