简体   繁体   中英

My apps script code has seemingly disappeared overnight. How can I recover it?

I was not sure what to the title this, but the title is accurate. My apps script code I spent the last few days working on has up and vanished from the project.

I have a web app that I re-wrote all the javascript for over the last new days, it was working fine and I even deployed it as a new version of the web app. However, upon opening the apps script file today all my changes are no longer there. The published web app still works though, even though all the code no longer exists in the project.

I can recover code from the published web app by just copying elements from the page, but I had made a lot of changes to the app afterwards.

Key Points:

  • Changes I made were saved, I even deployed a new version of it with some of the new code.
  • None of the code from the last few days exists in any files in the project, it's as if i never worked on it at all.

How did this happen? How can I recover my "lost" code from a google apps script project?

I figured this out. I was going to delete the question, but thought it would be better to post an answer for anyone else that runs into this.

The Cause:

It looks like I had left a tab open on my work PC with the apps script project open. When changes are made, they don't update on all views like with most Google docs/Sheets. According to the revision history, it looks like it overwrote my project some time in the middle of the night.

The Fix:

You can see this by going to File> See Revision History you can then revert to a previous version of your project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM