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.
I use 1.
I just compile my software using /usr/local
as the prefix and I'm done. I had no problem so far. I don't know whether I'll experience problems, but I started ~1y ago and so far so good.
However…
If I'd have to start again today, I'd follow 2 (which I didn't know at the time). That way it's easy enough to know where everything is and what, exactly, the software has installed (since the hierarchy for /usr/local/Cellar/foo/1.0
is something like
bin/ etc/ include/ lib/ share/
)
3 doesn't seem worth.
Best Answer
In Terminal I can think of two choice:
ls -R
.tree directory-name/
(after you install it; i.e.brew install tree
). The slash at the end preserves the display of special characters in the file the output is saved to.In both case you redirect the output to a file before and after installation and compare the two files possibly using Apple FileMerge.app shipped with Xcode.