Use git cherry-pick
来源:互联网 发布:淘宝网裤子带线 编辑:程序博客网 时间:2024/04/30 01:54
If you used commit -a -m to commit other branch's changes(branch A) to the current branch(branchB) by mistake, you want to put the last commit back branch A, so use
git cherry-pick logid
where, logid is the log id, which you can get from "git log"
The detail steps:
1. git checkout branch_B // go to branch_B
2. git log // Check the git log to get thelog id
3. git checkout branch_A // Got the branch A
4. git cherry-pick log_id // execute cherry-pick
5. git log // Check the log and you will find it works.
6. git checkout branch_B // go to branch_B
7. git reflog // you want to reset to the position before you commit, remember the reflog_id.
8. git reset --hard reflog_id // reset to the position before you commit
Over.
- Use git cherry-pick
- git cherry-pick 小结
- git cherry-pick简介
- git cherry-pick 小结
- git cherry-pick
- git cherry-pick
- git cherry-pick 小结 .
- git cherry-pick command
- git cherry-pick
- git cherry-pick
- git cherry-pick简介
- git:cherry-pick
- git cherry-pick简介
- git cherry-pick
- git cherry-pick简介
- git cherry-pick
- git cherry pick
- git cherry-pick简介
- eclipse 快捷键大全
- 网络编程常用接口的内核实现----sys_listen()
- 电脑启动后尽快找到网络
- uboot第一阶段详细分析
- 验证码识别代码(Java)
- Use git cherry-pick
- uva639 - Don't Get Rooked
- 常见的网络服务器软件综合比较介绍(apache、IIS、tomcat、jboss、resin、weblogic、websphere)
- Uncompressing Linux..... done, booting the kernel.
- 图片提交按钮与表单重复提交
- winform用户控件子控件访问权限
- iOS5 UIKit新特性
- Sqlserver 获取每组中的第一条记录
- Word Ladder