If I currently multi-select a bunch of objects and move them, but accidentally move them too far and hit undo, the pieces will move back as expected but I will lose my selection - this can be a bit painful if I have had to carefully select & unselect pieces after an initial group select. Whilst I can create a temporary group to get around this sometimes, it is a bit of a hack and not what I intuitively try to do in the editor.
It makes sense for undo to clear the selection if a piece was added/removed as part of the undo - so i'm not suggesting that this behaviour changes.
To fix this, the selection status of each piece needed to be taken into account when cloning the level (which undo/redo relies on). Then, we take a snapshot when adding/removing pieces to/from the selection.
Fixed in commit f32121c.