问题
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?
回答1:
It is about merge conflicts, from some merge you attempted before. The unmerged files are the files where the merge conflict happened.
As stated in the error message, you should take care of these files and the contained conflicts before you do anything else. One additional option is to do a hard reset - only attempt this if you know what you're doing.
回答2:
If you want to revert to the previous state of your work do:git merge --abort
来源:https://stackoverflow.com/questions/48151570/error-reverting-is-not-possible-because-you-have-unmerged-files