How can I undo Edit steps in Object Mode? From time to time I lose all edits because of undo in Object Mode. If I enter immediately after Undo in Edit Mode I can't redo, and switching again in Object results in losing all edit history.

How can I resolve this? Separating undo history by mode or linear/unified will both be acceptable.

Edit:I think the most preferable solution will be to disable/skip edit undos when in object mode through an addon.
This is just the way the undo system works currently. There has been some discussion about this lately, mainly due to this video (the part relevant to undo is at 8:12)

The trick when this happens is to redo in object mode immediately after undoing all your edit mode changes: