0

I'm not sure why this happened, but I worked on a branch called Settings.

This was maybe 2 wks ago. Then the Settings branch needed to be tested so I merged in the latest code from master so the merge would be less painful later.

Issue: For some reason, all the things I did originally on the Settings branch called clobbered.

Example: I had a SettingsController.cs file. Now when I merged in the latest from master, in SourceTree, I can see the SettingsController.cs file as deleted.

I'm not sure why this got deleted since I would think git would just apply whatever changes from master there were on top of my changes.

So I could do the down and dirty just copy and paste my code from github.com, but obviously that's not what I want to do.

So before I actually finish the merge, what's the best way to either do the merge correctly, or get out of this merge and bring in the last 2 wks of everyone's changes on master into my branch.

I typically do not have this problem when I pull in changes from another branch so I don't know why this time it was different. Any thoughts? Thanks in advance.

First Zero
  • 21,586
  • 6
  • 46
  • 45
Crystal
  • 28,460
  • 62
  • 219
  • 393

1 Answers1

0

If the merge is not yet complete, use git merge --abort.

If it is complete, then you want to roll back to two weeks ago: lots of ways to do this, including reverting, reseting, and using various tools like git gui and SourceTree. See this very good SO answer which details all the options and gives more references.

Community
  • 1
  • 1
Paul Hicks
  • 13,289
  • 5
  • 51
  • 78