If text formatting disappears in TextEdit on Mac
If you suddenly lose all formatting in a document, you may have accidentally converted your file’s format from rich text to plain text.
In the TextEdit app on your Mac, try any of the following:
Revert to a previous version of your document.
Choose Edit > Undo one or more times.
If you’ve made other changes you don’t want to lose since you lost the formatting in your document, convert it back to rich text (choose Format > Make Rich Text), then manually reformat the document.