Daniel Lemire's blog

, 2 min read

How to recover “lost” changes in CVS

3 thoughts on “How to recover “lost” changes in CVS”

  1. Marc says:

    I seem to remember that you can also do it by using cvs update -j, which is used for merging. Reverting a checkin is basically like a backwards merge.

  2. Guy Tremblay says:

    I think the simpler way alluded by Marc would be something like the following:

    cvs update -j 1.38 -j 1.39 myfile

  3. Scott says:

    Better late than never. Is that still true?

    For the record, if you use the double -j method, you need to put the revision numbers in the other order. To reverse the changes made by revision 1.39:

    cvs update -j 1.39 -j 1.38 myfile

    This usage computes the diffs needed to turn the first revision number into the second. If your objective is to turn the later revision back into the earlier one (i.e., to roll back the commit), then the later revision number has to come first.

    But is that what you intended, Daniel? Or is the merge step of the three files intended to restore the changes made in -r1.38 without clobbering other changes made in -r1.39? If so, then I don’t know of a better way to do it than the one you noted.