Question

I have committed changes to Git and pushed to origin. Another developer was having trouble merging. They did something and did a push. I saw an update and did a pull and half my changes were reverted! What happened? I'm guessing they had merge conflicts and used their version of the file but even so I can't find any history of my work in Git?

I'm using SourceTree and not quite comfortable with it yet. I've just installed Smart Git (more familiar with it) but not finding anything useful to discover what happened in either.

Was it helpful?

Solution

In SmartGit, open the Log and use Query|Load All Commits. This should give you your commits temporarily back, so you can add a branch to make them accessible again. After that either Merge, Rebase or Cherry-Pick your changes to master (assuming it's master you and your team is working on).

OTHER TIPS

If you are able to use the command-line, git log should show you all the commits.

If you have already pulled locally, then you can use the reflog to unwind what has happened. http://www.kernel.org/pub/software/scm/git/docs/git-reflog.html

You can then unwind if necessary and branch or cherry-pick to a new branch.

Or you can revert the merge. http://git-scm.com/2010/03/02/undoing-merges.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top