---
title: "revert(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsuserdefaultscontroller/revert(_:)"
---

# revert(_:)

Causes the receiver to discard any unsaved changes to bound user default properties, restoring their previous values.

## Declaration

```swift
@IBAction func revert(_ sender: Any?)
```

## Discussion

Discussion The receiver invokes discardEditing on any currently registered editors. The sender is typically the object that invoked this method. If appliesImmediately is true, this method only causes any bound editors with uncommitted changes to discard their edits.

## See Also

### Managing user defaults values

- [defaults](appkit/nsuserdefaultscontroller/defaults.md)
- [initialValues](appkit/nsuserdefaultscontroller/initialvalues.md)
- [hasUnappliedChanges](appkit/nsuserdefaultscontroller/hasunappliedchanges.md)
- [appliesImmediately](appkit/nsuserdefaultscontroller/appliesimmediately.md)
- [values](appkit/nsuserdefaultscontroller/values.md)
- [revertToInitialValues(_:)](appkit/nsuserdefaultscontroller/reverttoinitialvalues(_:).md)
- [save(_:)](appkit/nsuserdefaultscontroller/save(_:).md)
