git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to effectively undo a part of a commit
@ 2007-03-01 16:33 Bill Lear
  2007-03-01 16:51 ` Simon 'corecode' Schubert
  0 siblings, 1 reply; 2+ messages in thread
From: Bill Lear @ 2007-03-01 16:33 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-03-01 16:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-01 16:33 How to effectively undo a part of a commit Bill Lear
2007-03-01 16:51 ` Simon 'corecode' Schubert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).