sshfs / SublimeText = lost file

I had a bad experience with my Mac yesterday. I was trying to edit a .py file in SublimeText which was saved via sshfs, while also reading it on the local machine with the disk. Something went wrong with the save and before I knew it I had a 0 byte file on the disk and an empty buffer in SublimeText. File completely gone. (And in this case about 30 minutes of work lost; was just about to git commit, too :-().

I made it worse by not thinking carefully and closing the tab in Sublime. I think if I’d not done that, I could have hit undo and gotten the file contents back. For that matter I may have told Sublime to reload the file myself which was a mistake.

Still no idea why sshfs screwed up so badly. Or if it was an interaction with SublimeText.