How to recover previously saved text file after an overwrite and a reboot?
There is little hope unless one or both of the editors squirrel away copies of the file for you or embed the undo buffer in the document.

It really depends on the editors and the settings.

One last ditch effort is to use the mdfind command. If that file had a memorable string or misspelling you could see in an instant if any files on the disk contain that string. If you search for a common string, you'll have a lot of false positives, but it's worth a shot.

In this case, even software that recovers deleted files won't be of use when another editor truncates the file. It was shredded and not simply deleted



On a personal note, We all learn this lesson about data loss in a personal way, usually many times over. 

It's not overkill to have both version control and an automated backup system.

Time Machine is marvelous in that it makes hourly snapshots so you lose at most an hours work. Files that have been around for [a day|a week] are saved for [a month|until the drive fills]. It really works well in practice, and if you have local backups, you might even have snapshots more often than one an hour to recover a file. Sorry to hear you lost work, it's never a good feeling.