[Git] Undo my last commit and split it into two separate ones
2023-09-14 08:59:14 时间
When you accidentally committed some changes to your branch you have various possibilities to “undo” that operation and add some more changes. One is to use git amend
to change the commit message or add new files. But what we want to take out all of the committed changes again and maybe even split them into separate commits. Let’s see how we can achieve that. Note: This only holds if you did not yet push your changes to the remote repository.
In this case, what we can do is first do the reset:
git reset HEAD~
Then spreate files into diifferent commit messages.
相关文章
- Git知识总览(一) 从 git clone 和 git status 谈起「建议收藏」
- 日常IT技巧总结_it工作写经验总结
- Git删除本地分支_idea删除git分支
- git强制删除本地分支_Git分支
- 如何自建一个git服务器,搭建Git服务器,真的很简单
- 疫情之下,IT部门该如何为企业创造更多价值?
- 如何基于IT事件全生命管理周期,提升业务连续性?
- 英国超过 22% 的 IT 劳动力年龄在 50 岁或以上
- 【Git】Git 基础命令 ( Git 版本库概念 | 创建版本库 git init | 克隆版本库 git clone )
- 【Git】Git 分支管理 ( 解决分支合并冲突 | 创建并切换分支 git switch -c feature1 | 修改 feature1 分支并提交 | 修改 master 主版本并提交 )
- 【错误记录】Git 使用报错 ( git branch -a 仍能查询到已经删除的远程分支 )
- redis 执行命令报错:MISCONF Redis is configured to save RDB snapshots, but it is currently not able to pers
- ORA-19281: XQST0055 – It is a static error if a Prolog contains more than one copy-namespaces declaration ORACLE 报错 故障修复 远程处理
- ORA-19293: XQST0058: It is a static error if multiple schema imports specify the same target namespace ORACLE 报错 故障修复 远程处理
- 学习Linux如何使用Git代码版本管理(linux使用git)
- 完美搭建Oracle服务端:让IT管理更轻松(oracle服务端安装)
- 学习Linux下的Git版本控制(linux上使用git)
- Oracle一体机:无缝体验功能强大的IT管理(oracle一体机介绍)
- Linux环境下编译Git程序指南(linux编译git)
- 连接Linux:Git的使用方法(git连接linux)
- 深入浅出:Linux下Git使用指南(linux下git使用)
- IT男的真实人生:总被误认为是修电脑的
- 未来两年的5个关键IT安全问题
- Linux行为管理:构建安全可靠的IT系统(linux 行为 管理)
- 突破传统IT,掌控Oracle云环境(oracle云环境)