How can I prevent TextEdit from saving previous versions of a text file?
TextEdit and other app have a auto save feature enabled.

You can disable that in System Preferences:

Open the General preferences and enable the "Ask to keep changes", so it wont auto save, but ask you if you want to save it. This one would be system wide.

To do it only for TextEdit:

To disable autosave in TextEdit.app, run the following command in Terminal:

defaults write com.apple.TextEdit ApplePersistence -bool no


To turn it back on replace the no with yes.