[Git] Remove Files from Staging Before Committing
2024-09-05 14:35:13
If you've added files to the staging area (the Index) accidentally - you can remove them using git reset
.
We'll first add a file to staging, but then back it out with:
git reset HEAD filename
in order to pull it back to the working directory, so it doesn't end up in a commit when we don't want it to.
You created a new file lib.js
You have add to stating area.
git status
git add .
But later you find out that you don't want to add lib.js
git log --oneline
Run:
git reset HEAD lib.js
It will untrack lib.js file.
最新文章
- Magic CSS3 – 创建各种神奇的交互动画效果
- 如何采集QQ群中所有成员QQ号码
- React Native 开发笔记
- strip_tags() 函数剥去 HTML、XML 以及 PHP 的标签
- 抓取锁的sql语句-第四次修改
- javascript之attribute 和 property
- bzoj 1196
- cf492B Vanya and Lanterns
- opensatck 在启动的时候注入额外的信息
- childNodes属性 和 nodeType属性
- Java I/O---输入与输出
- Apache shiro集群实现 (二) shiro 的INI配置
- ASP.NET Core + Vue.js 开发
- CentOS 7 输入中文 &; 安装搜狗输入法
- python,获取用户输入,并且将输入的内容写到.txt
- Django 之缓存
- SG 大法(Sprague-Grundy函数)
- Linux下开发python django程序(模板设置和载入数据)
- 【leetcode 简单】 第一百零六题 压缩字符串
- e677. 模糊化图像