https://stackoverflow.com/questions/6919121/why-are-there-2-ways-to-unstage-a-file-in-git

git rm --cached <filePath> does not unstage a file, it actually stages the removal of the file(s) from the repo (assuming it was already committed before) but leaves the file in your working tree (leaving you with an untracked file).

git reset -- <filePath> will unstage any staged changes for the given file(s).

That said, if you used git rm --cached on a new file that is staged, it would basically look like you had just unstaged it since it had never been committed before.

最新文章

  1. Spring 4 使用Freemarker模板发送邮件&amp;添加附件
  2. 让/etc/profile文件修改后立即生效
  3. iOS架构师之路:慎用继承
  4. Windows内核原理系列01 - 基本概念
  5. 【腾讯Bugly干货分享】深入源码探索 ReactNative 通信机制
  6. [转]CPU的位数与操作系统的位数的区别
  7. gets(),fgets()的作用机制探究
  8. nodejs:csv模块解析
  9. 【转载】Visual Studio 2015 for Linux更好地支持Linux下的开发
  10. ARM1138@库函数速查
  11. C#——System.Diagnostics.Process.Start的妙用
  12. sqoop 操作从hdfs 导入到mysql中语句
  13. 站在Web3.0 理解IPFS是什么
  14. 屏蔽F12审查元素,禁止使用右键菜单
  15. Ajax请求中的async:false/true的作用[转]
  16. JavaScript(数据类型、字符串操作)
  17. android studio的汉化 教程 及解析
  18. python3 post方式上传文件。
  19. Extjs Column布局常见问题及解决方法
  20. Winform 常用的方法

热门文章

  1. OSPF选路原则
  2. Linux(4):文件属性
  3. 楼房重建(bzoj 2957)
  4. 【BZOJ1430】小猴打架(Prufer编码)
  5. 深入理解计算机操作系统——第10章:UNIX IO,打开,关闭,读写文件
  6. SUSE linux使用zypper 安装软件-比yum更好用
  7. poj2773求第K个与m互质的数
  8. ***apache做301重定向的方法
  9. python学习之-- socketserver模块
  10. PAT (Advanced Level) 1031. Hello World for U (20)