---
title: rollback()
framework: coredata
role: symbol
role_heading: Instance Method
path: coredata/nsmanagedobjectcontext/rollback()
---

# rollback()

Removes everything from the undo stack, discards all insertions and deletions, and restores updated objects to their last committed values.

## Declaration

```swift
func rollback()
```

## Discussion

Discussion This method does not refetch data from the persistent store or stores.

## See Also

### Related Documentation

- [processPendingChanges()](coredata/nsmanagedobjectcontext/processpendingchanges().md)
- [stalenessInterval](coredata/nsmanagedobjectcontext/stalenessinterval.md)

### Undoing changes

- [undoManager](coredata/nsmanagedobjectcontext/undomanager.md)
- [undo()](coredata/nsmanagedobjectcontext/undo().md)
- [redo()](coredata/nsmanagedobjectcontext/redo().md)
- [reset()](coredata/nsmanagedobjectcontext/reset().md)
