Somehow you have opened a file that is in MAT format.
Did you try to "save" in the name of your .m file? That would have overwritten it.
Did you have autosave turned on for your editing sessions? If so then the previous version of the file might still be around.
This is the sort of reason I have automatic backups running that save my files hourly...