Checking-out a Previous Revision

In the examples so far, we have been checking-out, editing, checking-in and locking only the most recent version of the file in RCS. These are adequate skills for gaining familiarity and habit in using version control. However, the benefits of version control comes from being able to access previous revisions of a file.

Retrieving revisions is done directly and simply by providing the revision number with the revision command-line option (-r). In the examples above, the revision was not specified in the RCS command but instead implied as a request for the latest revision. After checking-in the file the first time, the latest revision of the file could have been retrieved by specifying the revision with the following revision option:

$ co -r1.1 our_file.txt

The revision command-line option can be combined with the check-out's locking option. The checking-out and locking of the example's first revision could have been accomplished by combining the revision option with the lock option:

$ co -r1.1 -l our_file.txt

The lock option is actually able to take an argument in the same format as the revision option, allowing the above command to be abbreviated:

$ co -l1.1 our_file.txt

The above options are also recognized by the check-in command for combining the checking-in, checking-out and locking of a file and simulatenously specifying a specific revision. To check-in, check-out and lock the second revision:

$ ci -l1.2 our_file.txt