I can undo deleting a class/feature, but can’t undo creating or renaming.
Try this
Create a class (and name it for good measure) > delete it > create another new one > command+Z
(it will undo the second step, not the 3rd)
and try this.
Click into edit field > type something > click into class name > click again to edit > type something > command+z
(it will undo the second step, not the 4th)
In the second case I actually end up with 2 flashing cursors at the same time (one in each field) which is something I’ve never seen before.