I have a file in my Clearcase repository. I checked it out and modified it, and then checked it back in.
I haven\'t done anything like make a baseline, or rebase, o
Open version history for this file, then open in your editor a proper version of the file from the version tree, check out file once more, replace its with content of the previous correct version and check in. Don't forget to compare the previous version and the last version.
Clearcase can do much better than just making a new version where you undo the change! Open the version history on your file, find the version you mistakenly checked in, and destroy it (select version to destroy and find the appropriate command under the Versions menu). This is what rmver does too, if you want to use the command line. As VonC said your this destroys your mistake irretrievably. I'm not seeing a downside to that.
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.