code: public Response uncheckout(Session session, String path)
     {
  
        try
        {
           Node node = session.getRootNode().getNode(TextUtil.relativizePath(path));
  
           Version restoreVersion = node.getBaseVersion();
           node.restore(restoreVersion, true);
  
           return Response.ok().header(HttpHeaders.CACHE_CONTROL, "no-cache").build();
  
        }
        catch (UnsupportedRepositoryOperationException exc)
        {
           return Response.status(HTTPStatus.CONFLICT).entity(exc.getMessage()).build();
  
        }
        catch (LockException exc)
        {
           return Response.status(HTTPStatus.LOCKED).entity(exc.getMessage()).build();
  
        }
        catch (PathNotFoundException exc)
        {
           return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessage()).build();
  
        }
        catch (RepositoryException exc)
        {
           LOG.error(exc.getMessage(), exc);
           return Response.serverError().entity(exc.getMessage()).build();
        }
  
     }
docs: Webdav Uncheckout method implementation.
  
  @param session current session
  @param path resource path
  @return the instance of javax.ws.rs.core.Response