Why git can't do hard/soft resets by path?

前端 未结 7 1138
面向向阳花
面向向阳花 2020-12-07 17:33

$ git reset -- can reset by path.

However, $ git reset (--hard|--soft) will report an error like below:

7条回答
  •  不知归路
    2020-12-07 17:56

    You can accomplishment what you're trying to do using git checkout HEAD .

    That said, the provided error message makes no sense to me (as git reset works just fine on subdirectories), and I see no reason why git reset --hard shouldn't do exactly what you're asking of it.

提交回复
热议问题