Reverting to an older version of a file
[Previous] [Main] [Next]

Reverting to an older version of a file


There are two ways to revert to a previous revision of a file. The slower way to revert is to use the update command with a revision number and the -p option.

cvs update -p -r1.3 Deliver.java > Deliver.java

Now the Deliver.java is exactly the same as revision 1.3. When you commit, it will become the current version. Note: since you "printed" the previous version, the sticky date is not set.

Another method uses the -j option from update

cvs update -j -r1.4 -r1.3 Deliver.java

This will patch 1.3 with changes made in 1.4 and make that your current file. When you commit the changes the new file is given the next revision number. This is useful for doing lots of files at one time.