当前位置:网站首页>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!
边栏推荐
- ets declarative ui development, how to get the current system time
- 看到这个应用上下线方式,不禁感叹:优雅,太优雅了!
- shell之常用小工具
- JSON的Unicode问题;自定义排序问题;保留最大子集问题
- 北京 北京超大旧货二手市场开集了,上千种产品随便选,来的人还真不少
- 大缓存更强劲,搭载AMD Milan-X的浪潮GPU服务器NF5468A5深度评测
- 你的 golang 程序正在悄悄内存泄漏
- 宝塔实测-TinkPHP5.1框架小程序商城源码
- day01 -Web API介绍—DOM 介绍—获取元素—事件基础—操作元素—排他操作—自定义属性操作—节点操作—案例:动态生成表格—创建元素的三种方式(经典面试题)
- 服务器配置——Linux系统安装Redis
猜你喜欢
写个 shell 玩 数字炸弹
[Horizon Rising Sun X3 Trial Experience] WIFI connection, SSH login, TogetherROS installation (section 2)
逐步手撕轮播图3(分步教程)
史上最全JVM性能调优:线程+子系统+类加载+内存分配+垃圾回收
宝塔实测-TinkPHP5.1框架小程序商城源码
看到这个应用上下线方式,不禁感叹:优雅,太优雅了!
day02 -DOM—高级事件(注册事件、事件监听、删除事件、DOM事件流、事件对象、阻止默认行为、阻止事件冒泡、事件委托)—常用鼠标事件—常用的键盘事件
Jingdong, zhang, director of the cloud wireless products division treasure jingdong cloud wireless treasure close relationship with the open source | the great god, open source BUFF gain strategy revi
IJCAI 2022 | 基于随机游走聚合的图神经网络
Collection of shell basics
随机推荐
Collection of shell basics
深度学习网络结构图绘制工具及方法
IJCAI 2022 | 基于随机游走聚合的图神经网络
宏任务和微任务——三目算符与加号优先级——原生的js如何禁用button——0xff ^ 33 的结果是——in的用法——正则匹配网址
老手也常误用!详解 Go channel 内存泄漏问题
硬盘数据恢复工具
changes not staged for commit 解决办法
是不是只有字符串的数字水印能一直保留并且不影响计算,其他类型的字段导入数据库之后水印就会丢失?
【重构map】【重构filter】【重构Some】【重构reduce方法】【重构flat函数】
【cookie 临时存储数据,WebStorage ,sessionStorage】
在半小时内从无到有开发并调试一款Chrome扩展(Chrome插件/谷歌浏览器插件)
刷题《剑指Offer》day12
LeetCode 219. Repeating Elements II (2022.08.07)
案例分析 | 宜家以双钻设计模型探索线上零售新业务
#yyds Dry Goods Inventory#【Yugong Series】August 2022 Go Teaching Course 005-Variable
STM32的内存管理相关(内存架构,内存管理,map文件分析)
Jingdong, zhang, director of the cloud wireless products division treasure jingdong cloud wireless treasure close relationship with the open source | the great god, open source BUFF gain strategy revi
深度剖析-class的几个对象(utlis,component)-瀑布流-懒加载(概念,作用,原理,实现步骤)
day01 - Introduction to Web API - Introduction to DOM - Getting Elements - Event Basics - Manipulating Elements - Exclusive Operations - Custom Attribute Operations - Node Operations - Cases: Dynamica
写个 shell 玩 数字炸弹