[Git] Undo my last commit and split it into two separate ones
2023-09-14 09:00:49 时间
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用户名和密码_163邮箱用户名可以改吗
- Git—记录一次自建git服务器和客户端的过程
- Git使用流程_git提交流程
- cannot be resolved to absolute file path because it does not reside in the file system 问题解决
- 【Git】Git 分支管理 ( 创建并切换分支 | 查看分支 git branch | 合并分支 git merge dev | 删除分支 git branch -d dev )
- 【Git】Git 分支管理 ( 删除远程分支 | 查看远程分支 git branch -a | 删除远程分支 git push origin --delete feature1 )
- Git 2.40 发布,包括 git jump 工具的更新、cat-file 工具的增强以及提高 Windows 上响应速度
- Linux云计算架构师:破解IT之路的新门槛(linux云计算架构师)
- 新一代Oracle X6一体机:强大性能打造卓越IT体验(oracle一体机x6)
- Git在Linux系统上的安装及使用(git安装linux)
- Linux容器技术:改变未来IT世界(linuxcrs)
- 学习Linux使用Git进行版本控制(linux使用git命令)
- Linux内核管理:Git的力量(linux内核git)
- git和春天、Linux和Git一起收获成功(springlinux)
- 极速学习:Linux下使用Git的基础知识(linux如何使用git)
- Linux下Git安装指南(linux下git安装)
- IT之家 iOS / 安卓版 7.86 更新:评论/帖子审核进度查看/申诉/圈子大量改进
- IT男的专属28个谜语 你能猜中几个?附加答案
- Linux系统维护:振兴IT世界的利器(linux系统维护工具)
- 如何在Linux上配置Git:简易指南(linux下git配置)
- 深圳36岁IT男猝死马桶上 死前一天说太累了
- MySQL中的rand函数Note: This is a title and not an article. It is within the word limit of 25 characters.(mysql的rand)
- Linux下使用Git的快速安装步骤(linux下git的安装)
- Linux下安装Git的指引(在linux下安装git)
- 借助Oracle1CCDB解决IT数据管理困境(oracle1ccdb)