final LogQuery effectiveStateForRevision = transactionLog.getEffectiveStateForRevision(localOp.getRevision());
final State rewind = effectiveStateForRevision.getEffectiveState();
localOp.removeFromCanonHistory();
transactionLog.markDirty();
final Mutation mutation = lm.newBasedOn(rm.getPosition());
mutation.apply(rewind);
final OTOperation localOnlyOperation
= createLocalOnlyOperation(engine, remoteOp.getAgentId(), singletonList(mutation), entity, localOp.getRevision(), OpPair.of(remoteOp, localOp));
transactionLog.insertLog(localOp.getRevision(), localOnlyOperation);