MainspringGuides › Undo defaults write
macOS Guide

Undo a defaults write Command on Mac

Updated July 2026 · 3 min read

Every defaults write tweak has a matching undo: defaults delete. It removes the key you wrote, and the app falls back to its built-in behavior the next time it launches. Here's the exact routine, plus the one case where delete alone isn't enough.

The short answer: defaults delete

To undo a tweak, run defaults delete with the same domain and key you used in the original command, then restart the affected app. For example, if you made Finder show hidden files:

# the original tweak
defaults write com.apple.finder AppleShowAllFiles -bool true

# the undo: delete the key, then restart Finder
defaults delete com.apple.finder AppleShowAllFiles
killall Finder

Deleting the key doesn't set it to false — it removes your override entirely, so the app behaves exactly as it did before anyone touched it. That distinction matters for keys whose factory default isn't obvious. This works the same on macOS 13 Ventura, 14 Sonoma, and 15 Sequoia.

If you get "Domain (com.apple.finder) not found" or "does not exist", the key was already gone — you're done, or you've mistyped the domain or key. Copy them exactly from the original command; both are case-sensitive.

Check what's there before you delete

Reading the key first tells you whether your tweak is actually still in place, and records the value in case you want it back later:

# see the current value of the key
defaults read com.apple.finder AppleShowAllFiles

# 1 means true, 0 means false

Make this a habit in the other direction too: before running any new defaults write, read the key and note what comes back. If the answer is "does not exist," the undo is a plain delete. If a value comes back, someone (you, a setup script, another utility) already customized it — and to truly undo your change later, you'd write that old value back rather than delete the key.

Restart the app so the reset takes effect

Preferences are read at launch, so the reset won't appear until the app restarts. For normal apps, quit and reopen them. For system components, use killall — they respawn automatically:

# after undoing a Finder, Dock, or menu-bar tweak
killall Finder
killall Dock
killall SystemUIServer

Restart only the process that owns the domain you changed: Finder tweaks need killall Finder, Dock and Mission Control tweaks need killall Dock, and global keyboard tweaks in NSGlobalDomain generally need a log out and back in to reach every app.

When delete isn't what you want

Two edge cases are worth knowing. First, if the key had a custom value before your change, restore it explicitly instead of deleting — for example, if your Dock icons were size 48 before you experimented:

# restore a previous custom value instead of deleting
defaults write com.apple.dock tilesize -int 48
killall Dock

Second, never run defaults delete with a domain but no key — defaults delete com.apple.dock erases every Dock preference you have: pinned apps, size, position, all of it. If you've already done that to the Dock specifically, killall Dock rebuilds it with factory defaults and you can re-pin your apps; for other apps there's no automatic rebuild, which is why the whole-domain form is best avoided entirely.

Undo built in, every time

Mainspring turns 90+ hidden macOS settings into labelled, reversible toggles — it remembers the original value of everything it changes, so undo is always one click, never a Terminal session.

Try Mainspring free →

Signed & notarized by Apple · 1-day free trial · $29 once

Learn the write side properly

Undo is easiest when the original change was done carefully — with the right data type and a note of the old value. Our guide to defaults write on Mac covers the syntax, the type flags, and the read-first habit that makes every tweak reversible.