How do I restore revisions after uncommit

Asked by dom

http://bazaar-vcs.org/BzrVsHg says:

"Bazaar does not randomly change history. Even if you uncommit a revision from your branch, it is still present in your repository, and you can use it later if you like."

But I can't find any explanation how to do that.

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
Matt Nordhoff
Solved:
Last query:
Last reply:
Revision history for this message
Best Matt Nordhoff (mnordhoff) said :
#1

Since version 1.7rc1, "bzr uncommit" explains how to do it:

$ bzr init
$ bzr ci --unchanged -m test
Committing to: /tmp/bzrtest/
Committed revision 1.
$ bzr uncommit
    1 Matt Nordhoff 2009-02-05
      test

The above revision(s) will be removed.
Are you sure [y/N]? y
You can restore the old tip by running:
  bzr pull . -r revid:<email address hidden>

If you've lost that information, the bzrtools plugin (or, in bzrtools versions older than 1.5.0, the heads plugin) can help you find the right revid:

$ bzr heads --dead-only
HEAD: revision-id: <email address hidden> (dead)
  committer: Matt Nordhoff <email address hidden>
  branch nick: bzrtest
  timestamp: Thu 2009-02-05 09:48:28 +0000
  message:
    test

Revision history for this message
dom (dominikruf) said :
#2

Thanks for your quick answer.

Although I had to use
bzr merge . -r revid:<email address hidden>
because I already committed some changes.

Revision history for this message
dom (dominikruf) said :
#3

Thanks Matt Nordhoff, that solved my question.