login
Header Space

 
 

How to effectively undo a part of a commit

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git@...>
Date: Thursday, March 1, 2007 - 12:33 pm

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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
How to effectively undo a part of a commit, Bill Lear, (Thu Mar 1, 12:33 pm)
Re: How to effectively undo a part of a commit, Simon 'corecode' Schubert..., (Thu Mar 1, 12:51 pm)
speck-geostationary