How to reverse the defaults write com.apple.Safari CustomUserAgent "\"My user agent string\"" command Using the defaults write com.apple.Safari CustomUserAgent "\"My user agent string\"" command, you can set the default User Agent for Safari. This means that the CustomUserAgent key gets written in ~/Library/Preferences/com.apple.Safari.plist.

&lt;key&gt;CustomUserAgent&lt;/key&gt;
&lt;string&gt;My user agent string&lt;/string&gt;


But how can you reverse this action? (Manually deleting the two rows from the plist doesn’t work, as they just get rewritten when Safari restarts.)
defaults delete com.apple.Safari CustomUserAgent