Here you can find details about the saving mechanism.
Textastic automatically saves file changes every 10 seconds and when the file is closed to open another file.
By using the Undo button you can undo changes in the currently open file.