Sometimes user have instances where their code is gone, gets lost, disappears, etc. and it seems that hours of work is lost. No worries, a solution is detailed below, as well as a way to prevent this.
This happens when the workspace is open on another PC (whether a collaborator or another session by the same user) and that PC has saved out its copy before syncing with the server. With that, consider some of the following questions:
- Do you have that workspace open on any other computers?
- Do you have autosave turned on?
- Are there any other collaborators in the workspace and do they have autosave turned on
- Did code get reverted to an earlier state or did complete files disappear?
Use the revision history feature (only available in hosted workspaces, not SSH) to recover your code. If your file is completely deleted or gone, you can simply recreate that file and then use revision history.
Note that it must be the exact same file name (case sensitive) and location. If an entire folder is gone then you’ll need to recreate the folder and then create a file within that folder. From there, do the following.
- Click File > Show File Revision History
- Wait a second for the history to show up then go to the revision you want (usually 1 step back)
If you don’t have it open in 2 places at once, this won’t happen. If you close the IDE after use this also helps, as sometimes it reverts when the computer wakes up and the IDE reconnects and autosaves out the file.
We’re looking into a permanent fix for this so users don’t need to troubleshoot this. If you have any questions or thoughts on this then feel free to chime in.