Git: return all committed files to a directory,

I have a function branch feature-1created using a wizard. A lot of time passed, and I created a lot of commits on feature-1.

Now I want to undo the commit of all changes in a specific directory, say src/modules/feature-2I made the branch feature-1back to state, since they are in master.

I'm sure this should be possible in git, just don't know how to do it !?

+6
source share
1 answer

Just register the src / modules / feature-2 directory from branch feature-1to branch origin/master.

$ git checkout feature-1
$ git fetch
$ git checkout origin/master src/modules/feature-2/

You now have the identical src / modules / feature-2 directory in masterand branches feature-1.

+4

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


All Articles