Zend certified PHP/Magento developer

Numbered file backups for Visual Studio code

Looking for a way to save/have numbered backups using Visual Studio Code – functionality on same lines that emacs supports.

I’m refactoring rather complicated set of javascript files. Actions typically involve renaming functions/variables/members etc – standard refactoring. Visual studio code does understand javascript much better than many other editors, but it’s not perfect because of the nature of javascript or sometimes I make mistakes.

My typical flow is save changes, run my tests (has to be done externally using shell scripts). If it works, commit the file and continue.

When things go wrong, I have to rollback changes. However committing on every save is not practical and I have to remember and it pollutes git history. I have tried local history feature of code, but it does not work for me as I tend to close the file when there are many files open and loosing the history.

Is there a way Visual Studio Code can be configured to create numbered backups of the file either through configuration or plugin? This way I can have last few changes of the file without committing.

Open to any other alternative suggestions like shell script that monitors the changes and does the backup etc. Only criteria is it should work on Ubuntu