How do I undo or back out changes?
There are several ways to get back to an earlier version:
a) When debugging a problem, you may want to base a bug fix on an
First you'll want to find the correct version of the package (you
bk revtool without a file name argument to
browse the package, or say
bk changes to see the
changes from the command line).
Once you have the version, say:
bk clone -r<version> master bugfix|
Then make the changes in bugfix.
Whether you merge them back into master or not is a policy
most companies create a bug fix tree (or series of them) and
engineers clone from "Project-1.0" and push back into that.
b) If a change came into your tree and more changes are also there
on top of the earlier change, you cannot use undo to get rid of
You can "exclude" that change by running
bk cset -x<version>|
which will create a change that removes the effects of the change
specified by <vers>
(and yes, you can later
c) If you pulled a change into your tree, and you are not ready
that change yet, then you may be able to undo it.
It has to be the most recent change or series of changes.
To undo it, find the versions that you want to get rid of, make
sure they are at the top of the graph, and run:
bk cset -x the change that
excluded the first change and the first change will come back).
This choice is by far the safest thing to do - no information is
lost and you can change your mind later.
bk undo -r<vers>,<vers>,<vers>|
How do I manually do an anti-delta on a single file?
bk cset -x does is recursively do a
get -e -x on each of the deltas in each of the files which
were part of the specified changeset.
If all you wanted to do was undo the effect of the
-i) on a single file, and that file was
last modified by the cset, then you can just X out the
-x like so:
bk edit -x+ file|
if you want to have some weird fun, you can keep repeating that.
All you are doing is manipulating the set deltas which make up the
How do I remove changes from the last pull? Basically, I am looking for a 'bk undolast' kind of command'.