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

后端 未结 4 939
伪装坚强ぢ
伪装坚强ぢ 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:20

    git checkout :/ discards all changes in the working tree and replaces it with what's in the index, regardless of the current working directory.

    https://git-scm.com/docs/gitglossary#gitglossary-aiddefpathspecapathspec

提交回复
热议问题