Change This solution will remove old commits from the repository (including any changes made to them). This is clearly not what the op was asking, but I will still leave the answer here for future readers.
git checkout master git rebase --onto AX~
I cannot guarantee that there will be no conflicts, but if you click on them, you can resolve them manually, git add conflict files, and then enter git rebase --continue .
Alternatively, you can force git rebase automatically resolve any conflicts by applying more recent changes at the top of any conflicting changes made to (or before):
git checkout master git branch backup
source share