# Can't use difftool to selectively revert changes

2 messages from 2014-02-25 to 2014-02-25. Participants: Robert Dailey.
Thread: https://gitlist.dev/t/35952

## Robert Dailey, 2014-02-25 15:22

Subject: Can't use difftool to selectively revert changes
Message-ID: <CAHd499BGt8KhU=QU7dZ+-AR67=3Rf7VhBXfiHg7Ks=vSg6YOQQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAHd499BGt8KhU%3DQU7dZ%2B-AR67%3D3Rf7VhBXfiHg7Ks%3DvSg6YOQQ%40mail.gmail.com

```
I have a branch called topic1 that is based on 'master'. For a
particular file in my topic branch, I want to revert some changes by
using my diff tool. I do this by comparing the original revision of
the file with HEAD like so:

$ git difftool $(git merge-base topic1 master) HEAD -- Path/SourceFile.cpp

When I make changes to the right side (HEAD) through my diff tool, and
exit, the changes aren't picked up and applied to my working copy.
Since I'm modifying HEAD, I think it should carry over the changes I
make. Is this by design or a defect? I don't know how else to
selectively revert changes to a file through my diff viewer.

```

## Robert Dailey, 2014-02-25 15:28

Subject: Re: Can't use difftool to selectively revert changes
Message-ID: <CAHd499CfVNwpoeKhzSqHd-gd9XLsGjUtk7dXd0dWPJgkd+a-Kg@mail.gmail.com>
URL: https://gitlist.dev/e/CAHd499CfVNwpoeKhzSqHd-gd9XLsGjUtk7dXd0dWPJgkd%2Ba-Kg%40mail.gmail.com
In-Reply-To: <CAHd499BGt8KhU=QU7dZ+-AR67=3Rf7VhBXfiHg7Ks=vSg6YOQQ@mail.gmail.com>

```
Sorry I'm going to go ahead and answer my own question:

$ git difftool $(git merge-base topic1 master) -- Path/SourceFile.cpp

I removed 'HEAD' from the command and now it picks up my changes and
compares to my working copy version (which is actually what I wanted).
I thought HEAD would point to my working copy version but that's
wrong.

Sorry for the superfluous post!

On Tue, Feb 25, 2014 at 9:22 AM, Robert Dailey <rcdailey.lists@gmail.com> wrote:
> I have a branch called topic1 that is based on 'master'. For a
> particular file in my topic branch, I want to revert some changes by
> using my diff tool. I do this by comparing the original revision of
> the file with HEAD like so:
>
> $ git difftool $(git merge-base topic1 master) HEAD -- Path/SourceFile.cpp
>
> When I make changes to the right side (HEAD) through my diff tool, and
> exit, the changes aren't picked up and applied to my working copy.
> Since I'm modifying HEAD, I think it should carry over the changes I
> make. Is this by design or a defect? I don't know how else to
> selectively revert changes to a file through my diff viewer.

```
