Use this command to reverse the last editing action, if possible. The Undo command is disabled if you can't reverse your last action, or if you have set the Undo steps Preferences setting to 0.

You can't alter the contents of an editor that is being run or debugged, nor marked as read-only.