1

I am trying to revert to a specific revision of Google Sheet with Apps Script. I tried a couple of approach but none of them work.

Got some info about revisions here https://developers.google.com/apps-script/advanced/drive#listing_revisions

I also tried as following different approaches

Drive.Revisions.remove("xxxxxxxxxxxxxxxxxxxx", 658);

Drive.Revisions.update(resource, "xxxxxxxxxxxxxxxxxxxxxxxx", 657);

Drive.Revisions.update(resource, "xxxxxxxxxxxxxxxxxxxxxxxx", 657);

None of the above works. Can anybody suggest what I am doing wrong or I am missing something ?

Hari Das
  • 10,145
  • 7
  • 62
  • 59

1 Answers1

1

I assume here that you are talking about an older version of the script file that is attached to the spreadsheet. The script file can be thought to consist of various individual files eg main.gs, indexi.html etc, If you need to you can access older versions of each of the individual files within the script file but not the script file itself. Go.to the script file choose the individual files you want to recover and then select file -> see revision history and choose the version you would like to recover.

Tanya Gupta
  • 560
  • 4
  • 15
  • 1
    Outdated answer - only available with `legacy editor` now. Being replaced with https://developers.google.com/apps-script/concepts/deployments. – Neil Smithline May 05 '21 at 22:28