For me "Local History" feature in WebStorm solves the issue.
https://www.jetbrains.com/help/webstorm/local-history.html
The only things to watch out for with local history in these IDEs is that the snapshots are deleted after five days by default, and all are wiped if you need to delete your IDE cache for any reason.
It can and should be done automatically by the IDE to enhance developper productivity by getting out of its mind. There is no reason why I should be thinking about that, isn’t that all the point of using IDE and tools to develop ? Seems like using git for that is still re-inventing the wheel
Thanks for mentioning it - absolutely perfect!