A colleague, whom we'll call Aaron, was assigned to renovate a section of a website as a long-term project. He created a new Git branch, called aaron
. All his changes were made on this branch. While he was working, I continued to maintain the site as a whole, committing my changes to master
.
Eventually, Aaron merged his branch into master
. This somehow reverted all of the commits I'd made to master
between the time of the merge and the time when the aaron
branch was first created. If I type git show <hash of merge commit>
, I can see diffs for every file I changed while Aaron was working on his branch. Those diffs show a reversion of every change I made. It looks the way it would if Aaron had manually copied the contents of each file on his branch into master
and committed the changes. (He didn't do this. I'm just trying to illustrate what the log is showing.)
According to Aaron, he didn't do anything weird. He says he just ran git pull origin/aaron
.
What could have caused this? Is it possible that git pull origin aaron
would have reverted all my changes to master
?
Also, is there an easy way to reinstate my changes to master without reverting all of his work?
EDIT 1:
One of the files that was changed in master
and then reverted after merge was foo.txt
. So I did this:
git checkout aaron
git log foo.txt
The log does not reflect any changes to foo.txt
after the moment the aaron
branch was created. I was sort of expecting to see a reversion of my changes somewhere in the log for the aaron
branch, but I didn't. So, is this final proof that Aaron did something other than the simple pull that he claims to have done?
EDIT 2:
I had said he typed origin/aaron
, but he actually typed origin aaron
. I've changed it above.
EDIT 3
As per suggestions below, I chose to solve this by rewriting history. I am at this point convinced that the problem was caused by a misguided attempt to resolve conflicts.