error: Reverting is not possible because you have unmerged files

sashoalm picture sashoalm · Jan 8, 2018 · Viewed 16.2k times · Source

When trying to revert a specific commit in git, I'm getting this error:

$ git revert aaaf93201a28a57d540d633b1b723b8e513a47ed
error: Reverting is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm '
hint: as appropriate to mark resolution and make a commit.
fatal: revert failed

Is this about merge conflicts? But why does it say "unmerged files" in that case?

Answer

boonu picture boonu · Dec 9, 2019

If you want to revert to the previous state of your work do:git merge --abort