google-apps-scriptgoogle-workspace

Apps Script project reverted to an earlier version and all project history is gone- what do I do?


I opened an Apps Script project today that I've been working on for about a month. It seems to have reverted to a version from about two days ago and I'm not sure why. In any case though, when I checked my Project History there were no entries except from when I logged in today. There's no version to revert to. Is there a way I can find the lost version history?

I assumed I had left a tab open with an older version of the project and that tab auto-saved so that the last update was a less-complete version. I tried finding the last intentional save from last night, but my version history is gone.


Solution

  • The current Google Apps Script editor doesn't have an autosave and doesn't synchronize files opened across multiple windows and devices.

    New versions are created when a new deployment is made, or a new one is designed for an existing deployment.

    As you mentioned, the Project History doesn't show versions, I'm sorry to tell you that you cannot recover your work.

    Next time, please don't open multiple Google Apps Script editor windows for the same project. If you have to do this, please ensure that you create a new deployment or a new version if your project still needs one. When working collaboratively on a project, please ensure that the collaborators do not edit Apps Script files using the online editor simultaneously.

    Consider making daily (or end-of-workday) backups for added security, especially after making substantial changes. You can use the Google Apps Script API, tools like Clasp, or web browser extensions like Google Apps Script GitHub Assistant. These tools can help you keep your work safe and prevent potential data loss.

    Reference