I am using git as a version control system, and using git-flow as the branching model. I started a feature branch some weeks ago in order to maintain the system in a clean state while developping that feature. The main development continued on the develop branch, and changes from develop were merged periodically into the feature, to keep it up to date as much as possible.However came the time where the feature was finished, and I used git-flow's finish feature to merge the feature back into develop. The merge was successfully done, but then I found out that some of the commits I made in develop were reverted by the merge commit!Nowhere in develop or in the feature branch were these changes reverted, I can't see any commit that overwrote them. I just can't find anything. The only theory I have for the moment is that git is failing on me, but that would be extremely unlikely. Maybe I did some kind of wrong manipulation that made this situation come true?I can trace back in the history when the commit was made. I can see that the changes from that commit were reverted by the merge commit. Nowhere in the branch I see a commit that reverts those changes. Yet they were reverted.How is this even possible?
Finish feature reverted commits from develop
git;branching;merging;gitflow
Finally, it was an error on my part. I recently migrated the projet from SVN to Git, and I had then feature branch in SVN and it was not in sync with the trunk when I made the migration. I created the first commit in the develop branch with the trunk, and then started a new feature-branch with git, and commited the files as they where in the SVN feature branch. The commit being newer on the feature branch, and because it was not in sync with the latest trunk changes, Git thought, and for a reason, that the reverted changes were made after the initial commit, bringing these changes in when I merge the branch back into develop.I resolved this in a separate branch, with a lot of manual work, but now I know that it was not git's fault.