Daniel Lemire's blog

, 1 min read

How to recover “lost” changes in CVS

Suppose someone destroyed one of your file revisions by checking in a file undoing any changes you made. While your version is still in the CVS tree (you are using version control, aren’t you?), you don’t know how to merge them with the current version of the file.

Well, here’s a hack that will do it:


cvs update myfile
cvs update -r 1.39 -p myfile > mychanges
cvs update -r 1.38 -p myfile > beforemychanges
merge myfile beforemychanges mychanges

I’m sure there is a cleaner way to do it.