0

I've tried the suggestions in posts under this heading to no avail. I also am trying to multiple commits back to a particular point in my project. My latest attempt was: git revert --no-commit f8fae3b..HEAD I got the following error:

error: your index file is unmerged

fatal:revert failed

2
  • What does git status produce (and what version of Git do you have installed)? (I think you are probably stuck in the middle of an ongoing revert right now, and if your Git is not too terribly ancient, git status will say so.) Commented Aug 30, 2017 at 18:01
  • Yes. git status revealed uncommitted stuff. I aborted the revert, commited the changes and reverted again. Worked! Thx all. Commented Sep 1, 2017 at 1:03

2 Answers 2

1

You have to commit first what you have in your index (staging), or just discard it. git status will help you.

Sign up to request clarification or add additional context in comments.

Comments

0

You have uncommitted changes.

If you don't want those changes, you can throw them out.

git reset HEAD -- .
git checkout -- .

If the changes included new files, they might remain as "untracked"; if that seems like a problem you could git clean

If you do want the changes, you can either commit them (but then you have to make sure you don't accidentally discard them with your revert command) or stash them (git stash). (When you stash them, they'll seem to disappear; but then after you complete the revert you can git stash pop.)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.