I created a test branch on a master branch and made some commits on it. Among these commits there were auto-formatting changes. So when I type
git diff master test
I can see almost every line with old formatting removed (- in red) and added (+ in green) a new line with a new formatting.
I would like to keep my changes on a test branch but I would like to restore the old formatting. Is that even possible? Does git know which new lines correspond to the old lines? If the line was modified it would be easy to do, but git diff displays it as a removed and then an added line - like they had nothing in common in git's mind.
I tried various merge strategies, but it seems that this problem needs something more.