On Wed, 30 Nov 2011 08:25:22 -0800 (PST)
haziz <hsa...@gmail.com> wrote:

> While trying to revert a commit I made to my repository of my .emacs.d
> folder I get the following message:
> haziz@haziz> git revert 7fe3f
> error: could not revert 7fe3f0b... .emacs.d contents from ubuntu hp 15
> hint: after resolving the conflicts, mark the corrected paths
> hint: with 'git add <paths>' or 'git rm <paths>'
> hint: and commit the result with 'git commit'

> What I am trying to do is reverse changes I made to my init.el file
> and have followed with another commit which I am trying to reverse. I
> would prefer to revert rather than reset --hard since as far as I know
> the latter completely erases the most recent commit. I would like to
> create a new commit so that I can possibly "revert" the revert.
> In other words what I am trying to do is this
> Git Commits [A]...[B]
> would be reverted to
> Git Commits [A]...[B]...[A']
> Am I doing something wrong?

There's nothing unusual in the behaviour you observe: git-revert
basically "generates a patch" which, when applied to the current
branch's HEAD, would revert the changes the commit being reverted
introduced.  Quite obviously, if such a "patch" does not apply cleanly
(there are conflicts) Git refuses to proceed--exactly what you see.
Supposedly one or more commits after [A] touched the same lines in the
same file(s) as [A] modified, hence the conflicts.
Resolve them and proceed as Git suggested.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to