Comment 3 for bug 386544

Revision history for this message
Neil Martinsen-Burrell (nmb) wrote :

This bit me recently. I was able to recover with the following process (motivated by the warning message that ``bzr uncommit`` gives when it rolls back a commit.

1. Find the revision-id of the last revision in your original branch. If you have an unaffected version of the same branch, then you can use ``bzr log --show-ids -r -1``. If not, you need to poke around in the index files to see the revisions that live in the repository. For me, that looked like:

$ bzr dump-btree .bzr/repository/indices/<some obscure pack name>.rix

Look for a sequence of revisions that all happened within seconds of one another. These are from fast-import. The revision before these is the one you want. It's revision-id is in the FIRST tuple. The later revision-ids are its parents.

2. Do ``bzr pull . -r revid:<the revision id from step 1>``. This should give you many, many conflicts, but you can check to make sure that this is the revision you want. Then re-do the pull with the ``--overwrite`` option to get back to where you started. You can also pull this revision into a new branch.