code: function () {
            var level;
  
            if (self.typing) {
              self.add();
              self.typing = false;
              setTyping(false);
            }
  
            if (index > 0) {
              level = data[--index];
              Levels.applyToEditor(editor, level, true);
              setDirty(true);
              editor.fire('undo', { level: level });
            }
  
            return level;
          }
docs: Undoes the last action.
  
  @method undo
  @return {Object} Undo level or null if no undo was performed.