Html file became a rtf file then a txt file I have been working on a html file on my mac os 10.10 via Texedit for about a week. When I started my computer today the file appeared on my machine as an rtf, and when I opened it I saw my page as rich text with no javascript of html tags. I then tried to restore it but all the versions were rtf. I then choose to view the page a plain text and restore again and now all the versions were plain text. Again no javascript or html tags. How can I restore my file as a html file?
I had the same problem and found this resource to help me:


Create your HTML document by writing the HTML codes in TextEdit. But when you try to save do not choose Web Page in the file formats drop-down. If you choose this, all of your HTML codes will appear on the page.
Go to the Format menu and choose “Make Plain Text.”
Save the file with a .html extension. Then you can edit the file in any other text editor as plain HTML.


But if you need to edit it in TextEdit later, you need to change TextEdit preferences. If you don't change the TextEdit preferences, it will open your HTML file as an RTF file, and you will lose all your HTML codes. To change the preferences


open TextEdit and choose “Preferences” from the TextEdit menu.
Switch to the “Open and Save” tab.
Make sure the checkbox is checked in front of “Display HTML files as HTML code instead of formatted text.”
It also helps to have TextEdit default to text files (instead of Rich Text) if you use it to edit HTML a lot. To do this, switch back to the “New Document” tab and change the Format to “plain text.”