当前位置:网站首页>changes not staged for commit solution
changes not staged for commit solution
2022-08-08 12:38:00 【cat with wings】
New understanding of checkout in git
1. Problems encountered?
When I was working on Git today, I wanted to roll back a certain branch, a certain file or class in the Linux environment. I found that many online commands roll back the entire folder at one time, which is different from windwos.In IDEA, we can directly use the graphical operation point git Rollback, but under linux, we need to type a rollback command. What is this command?
Goal: Revert this release.sh as a single file
The previous understanding of git checkout is that you can perform the following operations:
git checkout branch name # used to switch branchesgit checkout -b branch name # used to create a branch and switchgit checkout HEAD
The following is my understanding:
git actually maintains a series of historical records, each historical label is the id of a record, and different branches represent different pointers, pointing to a certain historical label, along that label, you can view all's history.HEAD is also a pointer, but we often point it to the same history record as the branch pointer, and the git checkout command is used to move the HEAD pointer.
To fix the problem:
git checkout HEAD [ filename ]
or git checkout - - [ filename ]
to undo all changes made to the workspace, so that all previousThere is no modification, use it with caution!

边栏推荐
- nvm的使用 nodejs版本管理,解决用户名是汉字的问题
- 消防安全知识培训讲座
- 【AI系统前沿动态第45期】Hinton:深度学习的下一个大事件;一块GPU训练TB级推荐模型不是梦;AI-GPU显存优化发展史
- 详解轮播图二-通过left定位来轮播图片
- 五面阿里巴巴拿offer后定级P6:分享自己的面试经历
- ets声明式ui开发,怎么获取当前系统时间
- 京东云无线宝产品部负责人张晓东 : 京东云无线宝与开源的亲密关系 | 《大神详解开源 BUFF 增益攻略》讲座回顾...
- 部署spark2.2集群(standalone模式)
- Some optional strategies and usage scenarios for PWA application Service Worker caching
- odps sql被删除了,能找回来吗
猜你喜欢

大缓存更强劲,搭载AMD Milan-X的浪潮GPU服务器NF5468A5深度评测

Replication监控及自动故障切换

模式识别 学习笔记:第八章 特征提取

Collection of shell basics

论文阅读《Omnidirectional DSO: Direct Sparse Odometry with Fisheye Cameras》

萤石、小米对垒智能摄像头

Combining "xPlus" to discuss the innovation and change of software architecture

如何使用shell来进行版本管理-以iptables为例

京东云无线宝产品部负责人张晓东 : 京东云无线宝与开源的亲密关系 | 《大神详解开源 BUFF 增益攻略》讲座回顾...

Five-faced Alibaba rated P6 after taking the offer: share his interview experience
随机推荐
MYSQL 的 MASTER到MASTER的主主循环同步
ssh 安全 之 密钥登录
五心红娘6月成功案列
如何使用shell来进行版本管理-以iptables为例
Acwing3452. 进制转换
皕杰报表之数据校验与处理
Software testing testing on behalf of the user
ets declarative ui development, how to get the current system time
如何在go重打印函数调用者信息Caller
(7)FlinkSQL将kafka数据写入到mysql方式二
模式识别 学习笔记:第七章 特征选择
Geoffrey Hinton:深度学习的下一个大事件
SQL实例 - 胜平负
神经网络分类
(8)FlinkSQL自定义UDF
微服务负载均衡器LoadBalancer实战
三个点语法和DOM观察者
shell基础知识合集
phpstyle安装管理mysql
node中package解析、npm 命令行npm详解,node中的common模块化,npm、nrm两种方式查看源和切换镜像