Permanently reset subdirectory to specific past state

后端 未结 2 383
你的背包
你的背包 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 18:08

    If you work out all of the commits that you want to undo, you can use git revert to back them out - this would be most useful if there was only one or two commits that were the troublemakers.

    CharlesB's answer is a simpler approach to take if there are lots of commits, or the commits touch other parts of the project (but you could actually work around that by using the -n (don't autocommit) flag, and only committing the changes you are interested in)

提交回复
热议问题