code: void rollback(ItemData item) throws InvalidItemStateException, RepositoryException
     {
        // remove from changes log (Session pending changes)
        PlainChangesLog slog = changesLog.pushLog(item.getQPath());
        SessionChangesLog changes = new SessionChangesLog(slog.getAllStates(), session);
  
        for (Iterator<ItemImpl> removedIter = invalidated.iterator(); removedIter.hasNext();)
        {
           ItemImpl removed = removedIter.next();
  
           QPath removedPath = removed.getLocation().getInternalPath();
           ItemState rstate = changes.getItemState(removedPath);
  
           if (rstate != null)
           {
              if (rstate.isRenamed() || rstate.isPathChanged())
              {
                 // find DELETED
                 rstate = changes.findItemState(rstate.getData().getIdentifier(), false, new int[]{ItemState.DELETED});
                 if (rstate == null)
                 {
                    continue;
                 }
              }
  
              NodeData parent = (NodeData)transactionableManager.getItemData(rstate.getData().getParentIdentifier());
              if (parent != null)
              {
                 ItemData persisted =
                    transactionableManager.getItemData(parent, rstate.getData().getQPath().getEntries()[rstate.getData()
                       .getQPath().getEntries().length - 1], ItemType.getItemType(rstate.getData()));
  
                 if (persisted != null)
                 {
                    // reload item data
                    removed.loadData(persisted);
                 }
              } // else it's transient item
           }
           else if (removed.getData() != null)
           {
              // No states for items left usecase
              ItemData persisted = transactionableManager.getItemData(removed.getData().getIdentifier());
  
              if (persisted != null)
              {
                 // reload item data
                 removed.loadData(persisted);
              }
           }
  
           removedIter.remove();
        }
     }
docs: Removes all pending changes of this item
  
  @param item
  @throws RepositoryException