git revert commit-hash-value alone won’t work. -m must be specified, and I’m pretty confused about it.

See details:

The -m option specifies the parent number. This is because a merge commit has more than one parent, and Git does not know automatically which parent was the mainline, and which parent was the branch you want to un-merge.

When you view a merge commit in the output of git log, you will see its parents listed on the line that begins with Merge:

In this situation, git revert 4cb43c6 -m 1 will get you the tree as it was in 336a48b, and git revert 4cb43c6 -m 2 will reinstate the tree as it was in b75a5d7..

what is parent number?

links:
https://git-scm.com/blog/2010/03/02/undoing-merges.html
http://www.gitguys.com/topics/git-object-commit/

revert vs reset
http://yijiebuyi.com/blog/8f985d539566d0bf3b804df6be4e0c90.html
http://blog.csdn.net/hudashi/article/details/7664460

Git: How to revert a merge commit that's already pushed to remote branch?相关推荐

  1. Git冲突:Your local changes would be overwritten by merge. Commit, stash or revert them to proceed.

    在pull Git仓库里最新代码时提示这个冲突:Your local changes would be overwritten by merge. Commit, stash or revert th ...

  2. git pull 报错 Your local changes would be overwritten by merge. Commit, stash or revert them to procee

    git pull 拉取的时候报错 Your local changes would be overwritten by merge. Commit, stash or revert them to p ...

  3. Git Rebase vs Merge, GIt Reset vs Revert

    Git merge vs Rebase 构造场景如下: https://zhuanlan.zhihu.com/p/29682134?utm_source=wechat_session Git Rest ...

  4. Your local changes would be overwritten by merge. Commit, stash or revert them to proceed.

    和同事一起使用git .今天pull时候出现这个提示. Your local changes would be overwritten by merge. Commit, stash or rever ...

  5. Git详细使用大全- rebase, merge, switch, cherry-pick, tag

    Git2.3 目录 文章目录 推荐阅读 前言-各个版本控制工具对比 集中式版本控制工具 分布式Git Git分区 工作流程 0.配置 查看签名 设置签名 查看签名文件 设置例子 1. 版本库与文件操作 ...

  6. Git Pull Failed: CONFLICT (content): Merge conflict in camus-aggregator/camus-admin-web/src/main/web

    今天使用idea+git提交项目的时候,我的操作过程是这样的commit -> pull  然后就在这个pull这出现了文件存在差异 我就对差异文件进行了修改,之后我再次pull的时候就出现了这 ...

  7. git egit 如何 revert恢复原来代码

    egit中没有revert选项,因为在git术语中revert代表了再提交一次回退之前的提交(revert in git lingo means create a new commit to reve ...

  8. 三分钟教你学Git(二十七) - 修改多个commit

    比如我们又一个历史提交A->B->C->D, 当前HEAD在D commit上,我们想要修改B,C commits,该怎么做呢? 我们知道用git commit --amend可以修 ...

  9. 解决git提交敏感信息(回退git版本库到某一个commit)

    解决git提交敏感信息(回退git版本库到某一个commit) Fri 07 June 2013 git是一个很好的版本库, 现在很多人用它, 并在github上创建项目, 相信大家都有过将敏感信息提 ...

最新文章

  1. maven配置阿里云镜像后Eclipse不生效解决办法
  2. spring发展历程
  3. 新手AS常见问题集锦
  4. CF815C Karen and Supermarket [树形DP]
  5. 【牛客 - 289K】这是一个沙雕题III(贪心,思维枚举,技巧trick,计算上下界)
  6. [转载] java如何实现一个字符串的反转和替换
  7. php js下拉框与文本联动,php mysql js 下拉框 二级联动
  8. CSS中可以和不可以继承的属性
  9. router vue 页签文字_vue-router实现tab标签页(单页面)详解
  10. java io-字节流/字符流-继承图
  11. 洛谷 P2622 关灯问题II (状态压缩+BFS)
  12. About abstract class.
  13. docker搭建python开发环境_PyCharm使用之利用Docker镜像搭建Python开发环境
  14. c语言取反运算详细步骤,C语言之位运算详解
  15. 性能课程笔记(五)性能分析思路[转载高楼]
  16. 计算机云维护是做什么的,IT运维是什么?云时代下的运维人员是怎样的?
  17. PASCAL VOC2012数据集
  18. 北卡教堂山计算机专业排名,2019上海软科世界一流学科排名计算机科学与工程专业排名北卡罗来纳大学教堂山分校排名第17...
  19. 汇编语言程序教程:从入门到精通!
  20. VS2019程序打包(带sql sever转access数据库)

热门文章

  1. 大前端 - 微信小程序
  2. SpringBoot集成mysql-connector-java数据库驱动
  3. okhttp上传图片和其他参数_阳光沙滩-Okhttp3 post上传文件的时候携带文件的参数的问题...
  4. 安卓小人html制作,告白小人在线制作
  5. 港科夜闻|香港科大2021年本科计划招生190人,首推人工智能延伸主修
  6. 【JZOJ3156】病毒传播
  7. 关于ESP32卡在上电复位无法下载的问题
  8. springboot整合Jasypt对数据库密码进行加密
  9. 1MB有多少字节,1mb有多少个汉字,流量就这样被把握住
  10. 【电商】FMS财务管理系统---数据流转模块组成