There are a few ways to discard changes to enterprise objects in an editing context. They include:
Invoking undo on an editing context, which reverses the latest uncommitted changes to enterprise objects in the editing context.
Invoking revert on an editing context, which clears the editing context’s undo stack, discards all inserted objects, restores all deleted objects, and refaults all updated enterprise objects (which often results in immediately updating their data).
Invoking reset on an editing context, which clears the editing context’s undo stack and removes all enterprise objects from the editing context. (It does not cause an editing context to refault enterprise objects but instead to forget them altogether.)
There are other ways to discard changes to enterprise objects, including those that refetch from the database. They are described in “Discarding Cached Objects.”
Last updated: 2007-07-11