https://www.cnblogs.com/sunshine-xin/articles/3521481.html 1. git rm --cached file will remove the file from the stage. That is, when you commit the file will be removed. git reset HEAD -- file will simply reset file in the staging area to the state…
GIT reset命令,似乎让人很迷惑,以至于误解,误用.但是事实上不应该如此难以理解,只要你理解到这个命令究竟在干什么. 首先我们来看几个术语 HEAD 这是当前分支版本顶端的别名,也就是在当前分支你最近的一个提交 Index index也被称为staging area,是指一整套即将被下一个提交的文件集合.他也是将成为HEAD的父亲的那个commit Working Copy working copy代表你正在工作的那个文件集 Flow 当你第一次checkout一个分支,HEAD就指向当前…
https://stackoverflow.com/questions/3528245/whats-the-difference-between-git-reset-mixed-soft-and-hard When you modify a file in your repository, the change is initially unstaged. In order to commit it, you must stage it—that is, add it to the index—…