I'd like to know if it is possible to restore a removed file from an older revision (a clean way to do it)
I've renamed a file for some tests, than I commited all my work (and I forgot to rename the file) and did a lot of other commits... When I realised, it was too late...
Regards, Ayman
The easiest way is to simply use bzr revert
with a revision number before the file was deleted:
bzr revert -rX path/to/file
bzr commit -m 'Bringing path/to/file back'
You don't need to merge anything.
If you know revision number when you removed that file (you can inspect history with bzr log -v
) then you can resurrect that file with merge command. So for file foo
and revision number N
you need to run command:
bzr merge foo -r N..N-1
E.g. for revision 287:
bzr merge foo -r 287..286
This command will restore your file as in revision 287. You need to commit this change and you done.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With