freeCodeCamp/guide/chinese/miscellaneous/how-to-undo-a-git-add/index.md

13 lines
398 B
Markdown
Raw Normal View History

---
title: How to Undo a Git Add
localeTitle: 如何撤消Git添加
---
# 撤消git add
在提交之前撤消`git add`
运行`git reset <file>`或`git reset`以取消所有更改。
在旧版本的git中命令分别是`git reset HEAD <file>`和`git reset HEAD` 。这在Git 1.8.2中有所改变
[资源](http://stackoverflow.com/questions/348170/undo-git-add-before-commit/348234#348234)