Re: Revert a single commit in a single file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 25, 2011 at 11:34, Thomas Ferris Nicolaisen
<tfnico@xxxxxxxxx> wrote:
> I tried asking the same question on the "newbie" list some time ago:
>
> http://groups.google.com/group/git-users/browse_thread/thread/d562b4eeac016711
>
> Basically, when I go
>> git revert <commit> <path>
>
> .. my expectation was that a new commit would be made reverting the
> changes from the old commit, but only for specified path/file.
>
> Maybe it's a bit of a corner-case, but still would be nice to have
> once in a while. What do you think?

It would. What you can do in the meantime is:

    git revert <commit>
    git reset
    git add <path>
    git commit ...
    git reset --hard # making sure you didn't have uncommited changes earlier
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]