I have a git repository where a teammate forked the branch and made commits and then remerged then reverted and some other steps I am unclear on... Those changes and then made commits on top of the merge. This caused my changes to be overwritten, such that the merge itself is pulling in other branch changes from COMMIT 3 and if I try to do a hard reset and remerge it always rewrites. I've tried applying patches but because of the changes in COMMIT 3 I cannot just apply a patch of commit 1, and I do not wish to creat a .gitattributes in 5 different directories and specify a merge strategy as suggested here: Is it possible to exclude specific commits when doing a git merge? .
Is there a simpler way to merge and keep my changes?
This diagram should show the commit structure:
HEAD
|
COMMIT 1
|
COMMIT 2 <-- MERGE branch mainline
| \
| BRANCH-COMMIT 1
| |
| BRANCH-COMMIT 2
| |
COMMIT 3 |
| \ |
| COMMIT |
* | *
*