code: public void undoChanges(CmsRequestContext context, CmsResource resource, CmsResource.CmsResourceUndoMode mode)
      throws CmsException, CmsSecurityException {
  
          CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
          try {
              checkOfflineProject(dbc);
              checkPermissions(dbc, resource, CmsPermissionSet.ACCESS_WRITE, true, CmsResourceFilter.ALL);
              checkSystemLocks(dbc, resource);
  
              m_driverManager.undoChanges(dbc, resource, mode);
          } catch (Exception e) {
              dbc.report(
                  null,
                  Messages.get().container(Messages.ERR_UNDO_CHANGES_FOR_RESOURCE_1, context.getSitePath(resource)),
                  e);
          } finally {
              dbc.clear();
          }
      }
docs: Undos all changes in the resource by restoring the version from the
  online project to the current offline project.<p>
  
  @param context the current request context
  @param resource the name of the resource to apply this operation to
  @param mode the undo mode, one of the <code>{@link CmsResource}#UNDO_XXX</code> constants
  
  @throws CmsException if something goes wrong
  @throws CmsSecurityException if the user has insufficient permission for the given resource (write access permission is required)
  
  @see CmsObject#undoChanges(String, CmsResource.CmsResourceUndoMode)
  @see org.opencms.file.types.I_CmsResourceType#undoChanges(CmsObject, CmsSecurityManager, CmsResource, CmsResource.CmsResourceUndoMode)