Permanently reset subdirectory to specific past state

后端 未结 2 348
你的背包
你的背包 2021-01-05 17:31

In a git repository I have a subdirectory that I want to reset to a specific state in the past (an earlier commit). Is it possible to undo all commits on files in a specific

2条回答
  •  伪装坚强ぢ
    2021-01-05 17:41

    The simplest way to do it to use the ability of git checkout to be applied on a subdirectory. Then stage and commit:

    git checkout  -- path/to/subdir
    git add -A path/to/subdir
    git commit -m "reverted files in path/to/subdir to what it was at "
    

提交回复
热议问题