Find commits in a reverted merge

I did a merge of a unfinished branch to master. I did a revert merge to reverse the code changes.

Now the problem is I cannot merge this particular branch again to master. So what I plan to do now is to create a new dummy branch and cherry pick the lost commits and put it in the new branch and merge the above branch to the newly created branch and resume development from the newly created branch. This would work.

  • Is there a naming convention for git repositories?
  • The mystery of the missing commit across merges
  • How to provide password ( that has @ ) when run “git clone https://remote.git” in python script?
  • Github pull request shows too many changes/commits
  • Aptana: Git merge without fast forward
  • Change source control plug-in in Visual Studio
  • My question is is there a neat way of achieving the same in git?

    I don’t want to do a revert of revert.


  • Why are there .sln, .suo and .csproj files?
  • Can't understand how gitignore ignores the folders
  • Xcode: sharing the same Bundle ID among multiple people
  • Converting non-standard Subversion repository to git
  • What exactly mean “:” when using git show?
  • Bitbucket Commit Push History
  • 2 Solutions collect form web for “Find commits in a reverted merge”

    Your second merge is not working because git understands that it is already merged.

    What you say about the cherry pick is an option. I propose you to use rebasing instead of cherry pick.

    git checkout dev
    // do your staff
    git add .
    git commit -m "Finish the work"
    git rebase master

    With this, you regenerate all the history of your dev branch again from the last position of master branch. And git will now allow you to merge it.

    Except the cherry-picking, which you probably should do, there is a tricky way to make git think the branch still not merged – replace the merge commit with identical non-merge commit.

    git replace --edit <merge commit>

    In the editor open the will be text like

    tree AAAAA
    parent BBBB
    parent CCCCC
    author ...

    Then remove the second “parent ” line (with CCCC), save, exit. Now the merge commit will be seen to git as simple commit, and the branch can be merged again.

    The replacement can be removed after second merge.

    Git Baby is a git and github fan, let's start git clone.