Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial: How to restore after rebase

I've accidentally pulled some changes from the main repo with --rebase parameter.

How do I restore the original repository state from the backup which was created during the rebase?

like image 876
Ivan Ivanov Avatar asked Nov 15 '11 07:11

Ivan Ivanov


People also ask

What does rebase do in Mercurial?

Rebase allows moving commits around in Mercurial's history (using a series of internal merges). This has many uses: moving changesets between branches. "linearizing" history.


1 Answers

hg unbundle is used to apply the backup file:

hg unbundle .hg/strip-backup/e64394fd5837-backup.hg 

However, this does not remove the new changesets that have been created by the rebase; it is probably a good idea to call hg unbundle from a repo that does not have the rebased changesets (i.e. clone latest version from server).

like image 78
daniel kullmann Avatar answered Sep 29 '22 12:09

daniel kullmann