- 新建一个文件:Untracked files
- 修改一个文件:Changes not stages for commit
- 运行命令git add 之后:Changes to be committed
- git commit 提交代码
撤销修改:
- 撤销add:git reset HEAD
<file>
或git reset HEAD – - 从Changes to be committed到Untracked files:git checkout .或git checkout –
<file>
- 撤销commit 到add之后:git reset --soft HEAD^
- 撤销commit 到add之前:git reset HEAD^