code: protected void undo() {
  
          try {
              boolean recursive = Boolean.parseBoolean(m_modifySubresourcesField.getValue().toString());
              boolean undoMove = m_undoMoveField.getValue().booleanValue();
              CmsObject cms = m_context.getCms();
              Set<CmsUUID> updateResources = new HashSet<CmsUUID>();
              for (CmsResource resource : m_context.getResources()) {
                  updateResources.add(resource.getStructureId());
                  if (undoMove) {
                      // in case a move is undone, add the former parent folder
                      updateResources.add(cms.readParentFolder(resource.getStructureId()).getStructureId());
                  }
                  CmsLockActionRecord actionRecord = null;
                  try {
                      actionRecord = CmsLockUtil.ensureLock(m_context.getCms(), resource);
                      CmsResourceUndoMode mode = CmsResourceUndoMode.getUndoMode(undoMove, recursive);
                      cms.undoChanges(cms.getSitePath(resource), mode);
                      if (undoMove) {
                          // in case a move is undone, also add the new parent folder
                          updateResources.add(cms.readParentFolder(resource.getStructureId()).getStructureId());
                      }
                  } finally {
                      if ((actionRecord != null) && (actionRecord.getChange() == LockChange.locked)) {
                          try {
                              m_context.getCms().unlockResource(cms.readResource(resource.getStructureId()));
                          } catch (CmsLockException e) {
                              LOG.warn(e.getLocalizedMessage(), e);
                          }
                      }
  
                  }
  
              }
              m_context.finish(updateResources);
          } catch (Exception e) {
              m_context.error(e);
          }
  
      }
docs: Undoes the changes.<p>