Can I disable OS X Lion Autosave and Versions?

Solution 1:

It can be done by running the following Terminal command (for Preview in this example):

defaults write $(osascript -e 'id of application "Preview"') ApplePersistence -bool no

Replace Preview in the above command with the name of whatever app you want to perform this on.

For TextEdit you must additionally run the following command, in order to avoid sandbox errors:

defaults write com.apple.TextEdit AutosavingDelay -int 0

Also see this answer on Ask Different.

Solution 2:

Go to system preferences, general tab, and check the box that says; ask to keep changes when closing documents. When you get out of that document a window appears that will ask you to revert changes. That is the option you need to click.

This will close out the window without saving any changes.

Solution 3:

As of 10.8.4 "autosave" is applied to all applications including Xcode. This is especially problematic for webapp scripters who may find their unexpectedly autosaved Python scripts crashing Apache without their permission. the above given terminal command works to stop Xcode's autosave:

defaults write $(osascript -e 'id of application "Xcode"') ApplePersistence -bool False

As of this writing, "Ask to keep changes when closing documents" is broken with Xcode, so clicking the red button will save a script without asking. So if your cat walked on the keyboard and you closed the window, Apache may crash from the cat's scripting.