在本地,由GIT管理的代码会同时存在于三个地方:working tree,index,repository
Working Tree:工作空间,就是本地仓库文件夹下面除.git文件夹内容外的所有文件。或者说是我们平时用编辑器打开来修改的文件。
index:索引,是一个临时的、动态的二进制文件,它描述的是整个版本库的目录结构。working tree中的文件通过git stash命令
repository:版本仓库
git reset --soft commit-id 仅回退commit内容
git reset --mixed commit-id 回退commit和index内容
git reset --hard commit-id 彻底回退到commit-id指向节点,repository内容,index内容,Working Tree中的内容都没有了。