Git project, magit and magit-wip mode which creates intermediate commits automatically. In general file editing, emacs file backups are pretty good; learn to work with them.
I think emacs should adopt vscode remote dev architecture: install a remote server and communicate with it using some rpc protocol. Maybe someone is working on it, I don't know.
This discussion should happen on the emacs dev mailing list, if you want to involve the core developers.