I work on a lot of legacy code that people attempt to rewrite. Sometimes these rewrites are done without tests and something doesn't make sense to me in the new branch. At that point, I like to switch to the old branch and find what the code used to be and see if a regression was introduced.
The way I do this is to stash my current changes, check out the new branch, look at the same file in the old branch (this file may have a different name between both branches, a name I don't know off the top of my head), maybe save it somewhere else, and switch back to the state I was in before all those steps to see the differences.
This is a lot of back and forth and I'm wondering if git itself provides better tools so I can skip the steps I'm using.
I develop in Intellij IDEA, but I don't know if that's relevant.
I'm not interested in downloading a git GUI for this, but if intellij provides something out of the box (or a plugin), I'd be fine with that.