Which means, don't go into the Tech tree and click around. As soon as you do, you can't go back to option A.
Which reminds me how much I've long wanted a "confirm change of research goal" dialog/second-button something. I've never really understood why the tech UI assumes that they only reason you'd ever be there is to change your research goal. This is a 4X game. Long-term thinking is a large share of my fun.
That's a lot of extra clicking. You can still browse the tech tree (even without triggering the situation I described), and hover over techs. Just DON'T CLICK on one. Yes, I know that precludes looking at the specializations, but for this one special case, it's more than worth the tradeoff of having to click a couple extra times every time I want to change techs.
Best case, I'd support "double click selects tech to research". Under no circumstances would I support any sort of a dialogue box, or other "must move mouse somewhere else to confirm" modality, which would include using the right mouse button for a pop up or the like. That's bad UX.