比如刚刚git add yourfile.cpp
想撤销的话,直接:git reset HEAD yourfile.cpp
这样add的文件 但是还没commit 的文件就恢复到原来的样子了
参考链接 :
https://git-scm.com/book/zh/v2/Git-%E5%9F%BA%E7%A1%80-%E6%92%A4%E6%B6%88%E6%93%8D%E4%BD%9C
比如刚刚git add yourfile.cpp
想撤销的话,直接:git reset HEAD yourfile.cpp
这样add的文件 但是还没commit 的文件就恢复到原来的样子了
参考链接 :
https://git-scm.com/book/zh/v2/Git-%E5%9F%BA%E7%A1%80-%E6%92%A4%E6%B6%88%E6%93%8D%E4%BD%9C