当前位置:网站首页>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 switch
git 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!
边栏推荐
- 微服务负载均衡器Ribbon实战
- 海外邮件发送指南(一)
- JSON的Unicode问题;自定义排序问题;保留最大子集问题
- #yyds干货盘点#【愚公系列】2022年08月 Go教学课程 005-变量
- STM32 entry development to make infrared remote control (smart home-universal remote control)
- Supervisor 后台进程管理
- PG核心篇--物理存储结构
- (原创)[C#] GDI+ 之鼠标交互:原理、示例、一步步深入、性能优化
- 北京 北京超大旧货二手市场开集了,上千种产品随便选,来的人还真不少
- 迁移学习(Transfer Learning)的背景、历史及学习课
猜你喜欢
模式识别 学习笔记:第七章 特征选择
nvm的使用 nodejs版本管理,解决用户名是汉字的问题
如何使用shell来进行版本管理-以iptables为例
字节跳动资深架构师整理2022年秋招最新面试题汇总:208页核心体系
开放原子开源峰会 - SmartIDE正式开源并发布v1.0版本
day02 -DOM—高级事件(注册事件、事件监听、删除事件、DOM事件流、事件对象、阻止默认行为、阻止事件冒泡、事件委托)—常用鼠标事件—常用的键盘事件
研究:有毒的PFAS化学品使全球各地的雨水无法安全饮用
【AI系统前沿动态第45期】Hinton:深度学习的下一个大事件;一块GPU训练TB级推荐模型不是梦;AI-GPU显存优化发展史
看到这个应用上下线方式,不禁感叹:优雅,太优雅了!
Redis 定长队列的探索和实践
随机推荐
“华数杯”建模学习(Matlab)
处理器的调试接口
Supervisor 后台进程管理
是不是只有字符串的数字水印能一直保留并且不影响计算,其他类型的字段导入数据库之后水印就会丢失?
Geoffrey Hinton:深度学习的下一个大事件
安科瑞预付费水电集团物业解决方案-Susie 周
(7)FlinkSQL将kafka数据写入到mysql方式二
论文阅读《Omnidirectional DSO: Direct Sparse Odometry with Fisheye Cameras》
模式识别 学习笔记:第七章 特征选择
一条SQL在MySQL中是如何执行的
PG核心篇--物理存储结构
day01 -Web API介绍—DOM 介绍—获取元素—事件基础—操作元素—排他操作—自定义属性操作—节点操作—案例:动态生成表格—创建元素的三种方式(经典面试题)
STM32 entry development to make infrared remote control (smart home-universal remote control)
刷题《剑指Offer》day12
三个点语法和DOM观察者
Redis 定长队列的探索和实践
如何在go重打印函数调用者信息Caller
宝塔实测-TinkPHP5.1框架小程序商城源码
结合“xPlus”探讨软件架构的创新与变革
海外邮件发送指南(一)