To further add to this conversation it feels like an inconsistent behaviour depending on what you last clicked/focused undo may not remove the component but undo a code change.
What then tends to happen people undo multiple times and then few changes are reverted so you're found tracking back your work in order to make sure everything looks as it should.
We have an existing report on the unexpected side effects when using Cmd + Z. I added the request to notify the user of what was removed/added with an undo/redo and will update you here with any news.