Reverting a branch to a previous version

It is often useful to revert the contents of a branch to those of a specific version. For example, if your current branch contains changes that you no longer want to release you can revert all or a portion of a project to the contents of any version.

  1. Checkout into your workspace the contents from the branch that you want to revert.
  2. Select Compare With > Another Branch or Version on the resource(s) that you want to revert.
  3. From the tag selection dialog box select the version to which you want to revert the branch.
  4. When the compare editor opens, review the differences that are shown and ensure that they are what you expected.


  5. Tip: If several files report as false differences (e.g. the files are shown but there are no actual changes in the files) select the Use File Contents toolbar button to recomputed the comparison using file contents instead of revision numbers.

  6. Select the root folder in the compare view and from the context menu select Copy All Changes From Right To Left. After the operation is completed the folder or project you compared against will have exactly the same contents as the remote revision.
  7. You can verify this by performing another comparison against the version. However this time, when the comparison completes select the Use File Contents toolbar button to redo the comparison using file contents instead of revision numbers. Note: you may also have to select the Ignore White Space button too.
  8. After the comparison using file contents completes the compare editor should be empty. Meaning that the files in your workspace are identical to the ones in the selected version.

Once your workspace contains the new contents, run your tests then commit the changes to the branch.

Related concepts
Team programming with CVS

Related tasks
Synchronizing with the repository
Committing

 
Copyright IBM Corporation and others 2000, 2003