Why are there two ways to unstage a file in Git?

后端 未结 12 1838
刺人心
刺人心 2020-11-27 23:48

Sometimes git suggests git rm --cached to unstage a file, sometimes git reset HEAD file. When should I use which?

EDIT:

D:\         


        
12条回答
  •  自闭症患者
    2020-11-28 00:34

    For versions 2.23 and above only,

    Instead of these suggestions, you could use git restore --staged in order to unstage the file(s).

提交回复
热议问题