Using git, how do you reset the working tree to the state of the index?

后端 未结 4 930
伪装坚强ぢ
伪装坚强ぢ 2020-12-23 19:02

Situation:

  1. Edit files
  2. Add files to the index
  3. Edit more files

Now we have three different states. The state of HEAD, the state

4条回答
  •  遥遥无期
    2020-12-23 19:37

    You can use git-checkout-index. Be aware that you need to add

    • -f to force it to overwrite existing files, or
    • -f -a to enforce overwriting all paths in the index.

提交回复
热议问题