4

This is what he says he did:

There was a merge conflict so I chose mine.

What I'm seeing is that my changes are totally gone. The commit is there, but if I go on GitHub and click 'history' for the file, there's nothing showing that my changes were ever there. I found the guilty commit but all it says about it is:

Conflicts:
        .../<file>.js

What I saw that looked fishy is the commit is titled:

Merge remote-tracking branch 'origin/development' into devenv

But development is our remote branch, so I'm guessing he merged to his local branch, goofed it up, and then accidentally pushed his local branch to development.

Would this cause the behavior I described? Any ideas on a clean way to fix this?

Edit: So it looks like a cherry-pick fixed the problem, I still don't quite get how it got into this state though. I couldn't find any evidence of a force push (Git not Star Wars).

Nick Volynkin
  • 14,023
  • 6
  • 43
  • 67
user3779812
  • 230
  • 3
  • 11
  • 3
    Ask if he had to a force push (`-f`) to resolve his situation. – Michael Durrant Jun 11 '15 at 18:49
  • He says he didn't, he does his stuff through his IDE too, I'm only familiar with the console. I looked at his command history and didn't see it there. Lots of `git push -u development` though. If he did this while on his branch could that cause this? – user3779812 Jun 11 '15 at 19:03
  • if at some point your commit was pushed, meaning, you saw the individual commit in GitHub then only a force push could have erased it. – bitoiu Jun 11 '15 at 19:07
  • @MichaelDurrant and beat him if he did ) – Nick Volynkin Jun 11 '15 at 19:08

1 Answers1

1

Nothing just disappears in Git. You can do one of the following:

  1. Undo the merge on development branch. Undo a Git merge that hasn't been pushed yet
  2. Cherry-pick your last commit (with all your contributions) from the history. How-to git backport (rebase/cherry-pick) an already merged branch
Community
  • 1
  • 1
Nick Volynkin
  • 14,023
  • 6
  • 43
  • 67