Is there a way to undo a deselect?

There is a Select RESELECT command, but unfortunately it only restores selections cleared by other commands (e.g. Copy), not de-selection via the mouse or Select NONE etc.

Checkbox Mode or Power Mode offer mouse/selection styles where it's harder to accidentally deselect things, which can be nice when building up a big selection. But you have to remember to use them, of course, and I almost never do either. (Or use them all the time, but I'm too used to the way things work normally.)

Scripts can monitor the selection (Dialog.WatchTab with an invisible dialog processing the events) but I don't know how good performance would be if one was saving every selection change in every tab. Which isn't to say it won't work, but it's not something I've tried or measured the impact of.

(BTW, Middle-click can do the same as Ctrl + Left-click if the MMB is set to a standard middle button.)