I have a branch that had some work on it, then it was merged into the main branch. Immediately after this, the merge has been reverted. I continued to work on my branch and the main branch also had changes. Now I need to merge those changes from the main branch to mine, but because of the former revert, some of my changes are removed. Of course I can add them manually, but there must be a "proper" way. Could you please help me?
A----B---D-X---E---G--I
\---C--/------F---H---\J
So my branch started from commit A, then I added commit C. Then it was merged into master branch with commit D, then reverted with X. Now when I merge the master to mine in commit J, I have all my changes in commit C removed.