Mercurial / Kiln, how can I get a deleted file without affecting my other files?

I have a file that has been deleted a few changes. As you can imagine, the other files in my project have changed since then. How can I return this file (it is actually 2 files) without returning all other source files?

+6
source share
2 answers

Use hg revert only for this file:

 hg revert -r REV path/to/deleted/file 

Using hg revert

If the file was deleted, it will be restored. If the executable file mode has been changed, this is reset.

If names are specified, all files matching the names are returned. If no arguments are given, files are not returned.

+10
source

Another approach to this is to use the Kiln website. You can search for a change set using the change set identifier, or simply use date search, for example. date:2011-10-01..2011-10-31

Then you will get a list of change sets, click the one that shows the version of the code you want to restore, and then if you click the Browse files at [changeset id] link on the right, you will get a list of folders and files at that point in time.

Then you can simply add new files to your project and cut and paste the code back into these new files.

Admittedly, this is not so good for recovering an entire file, but it is convenient if you want to restore part of the code, or if someone subsequently added a new file with the name of the old file.

0
source

Source: https://habr.com/ru/post/885677/


All Articles