Git: how not to delete files on reboot with commit file

I have a branch that I would like to reinstall on the last commit on my host. The problem is that one of the intermediate commits to the wizard was deleting and ignoring a certain set of files (see this question ).

If I just do a direct reinstall, these files will be deleted again. Is there a way to do this inside git and not copy all the files manually and then copy them again again?

Or do I need to do something like create a new branch from the master, and then merge only the commit from the old branch?

Attempts at ascii art:

master    branch
  |        w  work in progress on branch
  C        |  committed further changes on master
  |        |
  B        /  committed delete/ignore files on master
  |       2  committed changes on branch
  |      /  
  A     /  committed changes on master which I now need to get branch working
  |    1  committed changes on branch
  0___/  created branch

( , , A, , , , "" )

, . , , B- , : (

+3
1

, , dev , B.
, , , .

:

  • rebase --interactive ( )
    0--A--C'--B'  master
     \
      --1--2--w     dev
  • rebase dev C '( , B)
    0--A--C'--B' master 
           \
            --1'--2'--w' dev

, ( , /)

+2

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


All Articles