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

13 lines
398 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
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)