Now I have two branches master and dev. There are ten files on the master and nine files on the dev. These eight files are the same as the files on the master.
Now I modify the contents of 8 files on dev, and then switch to the master branch to merge the contents of dev. After that, the two files on my master branch also disappeared, and master completely became the dev branch. . But I still want those two files. How should this problem be dealt with?
Thanks for the help%%
仅有的幸福2017-05-02 09:54:50
The reason may be that you have deleted those files in dev
The concept of merge is "merging changes from other branches into this branch". Deleting in other branches is also a change that needs to be merged
You can recover those files after merging:
$ git checkout (含有想恢复的文件的commit) -- (想恢复的文件1的路径) (想恢复的文件2的路径)
$ git commit