It would be kinda cool to use git status to avoid accidental data loss for tools like this.
I've never interacted with git programatically so I don't know how messy it would be to implement. But for tools that mostly operate on "whole files" rather than lines in files, I guess it shouldn't be that tricky?