You can undo one or more of the most recent commits by using the uncommit
operation. This can be useful, for example, if you want to amend your last commit by changing the log message or adjusting the set of changes to include. The uncommit
operation moves the branch tip marker one or more revisions back, without changing the working tree, so that you can make any necessary adjustments and commit again.
To see how it works, let's grab a sample branch:
$ bzr branch lp:~bzrbook/bzrbook-examples/uncommit /tmp/uncommit Branched 6 revisions.
You can undo the last commit by using the
bzr uncommit
command without any parameters:
$ cd /tmp/uncommit/ $ bzr uncommit 6 Janos Gyerik 2013-04-20 changes just to demonstrate shelving The above revision(s) will be removed. Uncommit these revisions? ([y]es, [n]o): yes You can restore the old tip by running: bzr pull . -r revid:janos@axiom-20130420203136-bi9iglm2cevc8tfq
Bazaar shows the short log message of the revisions...