How do I roll back a file checked in to Clearcase?

What is described by skwllsp can be be done in a dynamic view through the use of extended pathnames

cd m:/myDynamicView/MyVob/path/to/file
cleartool lsvtree myFile
cleartool checkout -c "cancel co" myFile
copy myFile@@/main/xx myFile
cleartool checkin -nc myFile

with xx being the version number you want to restore.


But should you have made multiple checkins, including some you want to cancel, ClearCase allows you to cancel part of the previous checkins through Subtractive Merge
See IBM “to remove contributions of some versions” (and merge man page)

You can remove all changes from a range of versions at once. For example, the following command removes revisions to versions 14 through 16 on the main branch:

  • On the UNIX system or Linux:
cleartool merge -graphical -to opt.c -delete -version /main/14 /main/16
  • On the Windows system:
cleartool merge -graphical -to opt.c -delete -version \main\14 \main\16

You can also remove the changes from one version at a time. For example, the following commands remove only the changes in version 14 from the version of opt.c checked out the current view:

  • On the UNIX system or Linux:
cleartool merge -graphical -to opt.c -delete -version /main/14
  • On Windows systems:
cleartool merge -graphical -to opt.c -delete -version \main\14

Alternatively, in any of the examples above, you can leave out the -version argument if you use the version extended path for the contributor-version-selector.


Finally, the one thing to not do is a rmver.
This command destroys information irretrievably and this is rarely a good thing.

Leave a Comment