How to effectively undo a part of a commit

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

 



A colleague made a change to a file and committed it.  Then, he
made another change to the file and somehow undid the previous work,
then he committed the file.  Now, he would like to get the first change
he made and reapply it.

So, the changes look like this:

F1 -> delta 1 -> F2
F2 -> delta 2 -> F3

So, starting with F, he applies delta 1 to get F2.
Then, he applies delta 2 to get F3.

He says that using cvs he would do something like this:

% cvs update -j F1 -j F2

To apply delta 1 to F3.

We tried using git to get the delta 1 as a patch --- that went fine.
Then we used git-apply to apply the patch, but it refused, and it was
obvious that the line numbers of the patch no longer corresponded to
the line numbers in the file in his working tree.

Is there a way in git to do this, or is this an inherently unworkable
problem, as for some reason, I suspect?


Bill
-
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]