<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSUserDefaultsController/revertToInitialValues(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSUserDefaultsController(im)revertToInitialValues:"
  },
  "title" : "revertToInitialValues(_:)"
}
-->

# revertToInitialValues(_:)

Causes the receiver to discard all edits and replace the values of all the user default properties with any corresponding values in the [`initialValues`](/documentation/AppKit/NSUserDefaultsController/initialValues) dictionary.

```
@IBAction func revertToInitialValues(_ sender: Any?)
```

## Discussion

This effectively sets the preferences that a user can change to their “out-of-the-box” values. This method has no effect if initial values were not specified. The `sender` is typically the object that invoked this method.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)