My partner messed up with Google Drive and we now have 17,000 files/folders at the same "level" of hierarchy in Drive (both desktop and online). I was wondering how I could "go back in time" in order for us to recover that structure knowing that very few files were created and none were deleted.

If I turn off my internet connection and do a "restore system" on window, will that help me recover my structure on the Drive desktop folder? Also knowing that 95% of the files are not from the Google "Suite" but are Word, Excel (among lots of other formats).

  • Unfortunately, what you are asking for is not possible. Google Drive has no such feature.
    – user19533
    Commented Dec 25, 2013 at 17:00

4 Answers 4


I got a solution to work with a bit of copy/paste/find/replace and jay0lee's GAM (Google Apps Manager), which you will need to have installed. It's not pretty, and it will only work if you are using Google Apps for Business or Education, not a personal Google Drive account, but it beats manually moving each file back.

  1. Select the containing folder for all of the files affected.
  2. Click the (i) (details) button in the upper right.
  3. Select the Activity tab. This will show all of the files that have been moved. Scroll through the activity until you reach the end of the changes that you want to undo.
  4. Click and drag upward to highlight the description of all of the changes you want to undo and hit Ctrl+C (Copy).
    highlight the items in the right pane
  5. Paste into a text editor, or paste into Word as plaintext.
  6. Now you will want to do a find and replace to clean up this data. I used Word's find and replace to change this to an HTML table because it was what I knew how to do. There's probably a better way, but here's what I did. Click Replace.click replace in upper right
  7. Search for Jacob Marleyremoved*from and check "Use Wildcards"; replace with nothing to delete the first row in each section. (I assume Jacob Marley is your partner's name).wildcard search using asterisk
  8. Search for Computer*PM to remove the second row. This worked for me because all of the items were removed from a computer in the afternoon; you may have to modify if this took place over morning and afternoon, or on several different devices. Replace with nothing again.use wildcard search to delete second row too
  9. Finally, I'm ready to start converting to a HTML table. Uncheck "Use wildcards" and search for Google Drive Folder and replace with </td></tr><tr><td>
  10. All of my files were PDFs, with lowercase filenames, so this next part was easy for me: I just searched for PDF with "Match case" checked and replaced with </td><td>. If you have other formats, you will have to play around with this a bit. You may have some success by using ^p to search for paragraph marks; for example, ^pPDF^p would make sure that PDF has a paragraph break on either side.
  11. Go to the beginning of the document and add <table> to the beginning. Cut the first </td></tr> and paste it at the end of the document, followed by </table>.
  12. Paste everything into Notepad and save as changes.html
  13. Open changes.html in Excel (or open in your browser and copy and paste into Excel). What have now is a list of all of your folders, with the items that used to be in those folders in the columns next to them. If this information is what you needed, you may be able to stop here.
  14. I need to do some more cleanup before I'm ready to use this with GAM. I want one row per file, instead of one row per folder. Fortunately, I only had a dozen folders with more than one file moved, so I just added a new row for those files and pasted the folder name in the folder column. Now that it's in Excel, you can probably do something with a formula or pivot table to clean this up faster. I also added column headers folder and filename.before cleanup: one row per folderpost cleanup: one row per file
  15. Save the file as changes.csv (in csv format).
  16. Shift+Right-click in the folder containing changes.csv and select Open command window here. You need to have GAM installed and added to the PATH for this next step.
  17. Now you can move each file in column B into the folder in the column A using this GAM command: gam csv changes.csv gam user [email protected] update drivefile drivefilename ~filename parentname ~folder (replace [email protected] with the username of the Google Drive owner of the files). When I tried it, the script took about 2 minutes to move 400 files back to their original folders.
  • 1
    If you just have a personal Google Drive account instead of Google Apps, you may be able to use Google Script to do something similar to what I did with GAM in step 17.
    – browly
    Commented Aug 31, 2016 at 22:05

Conventionally, I would say that what you are asking for is not possible, there is no such feature in Google Drive.

You may however be able to restore to the previous structure more easily, if you had backed up your data on some other system too, such as Dropbox (by using IFTTT or something in those lines).

Apart from that, if you have Google Drive installed in your Windows or Mac, try disconnecting your system from internet and view the order of files in the drive.

Anyhow, at the end resorting will involve lot of manual dragging and dropping.


With PRIOR preparation ONLY: It IS possible to recover your precise state of all these folders, but with some caveats:

It is likely way too late for this user, (unless they also had regular backups from that time), but it might not be too late for others.

NOTE: this will NOT backup Google DOCS that are created by Google Apps. However, any files that are created by other apps like Word, Excel, etc. WILL be backed up.

  1. Run Google Drive DESKTOP and make sure it is running. Often, if Google Drive is not connected and logged in, the service won't warn you, and nothing is being synced. Now, anything that is in your Google Drive in the cloud, will also be on your PC. It is best to ALSO install it on other PCs you own, and leave them all running 24x7. Now, all your Google Drive files and folders are also on your local PCs.

  2. Google Drive will ONLY contain any files you created. It will also contain SHARED files or folders that you MANUALLY ADDED from the Google Drive WEB INTERFACE. That's right. NONE of the files or folders that are shared with you are added to Google Drive automatically. So, whatever you want backed up, make sure you drag it into your Google Drive FOLDER from the "SHARED WITH ME" folder, using the web interface.

  3. On one or more of the PCs you are using Google Drive with, run FREQUENT Snapshots. This should be in addition to your backups. Then you can recover exactly what every file and folder looked like at any specific date that you had taken a new snapshot.
    Windows 7 has snapshots, called "Previous Versions", which capture everything that changes throughout your whole hard drive. The problem of course, is that snapshots aren't being taken by Windows 7, except when manually initiated, or Windows decides it needs to take one, often after a reboot or Windows update. Worse, Windows 8-8.1 has no native snapshots that you can use. But, there is a workaround.

  4. Get an offsite backup utility with file versioning. Windows 7 has a backup that you could use, or there are many others.

If you are "stuck" with Windows 8, here's how you can get a backup of what you need--every copy of a file or folder. You can use "Windows 8 File History", (soon to be called and RENAMED to "Previous Versions" in Windows 10, which is NOT a snapshot). To do this, you'll have to make sure your Google Drive is contained inside a "Windows Library" (*). I strongly suggest that the Google Drive folder is NOT in the root of this "Library", unless that is the only folder in that Library **.

To store your "Windows File History", you can add either an external hard drive to your system, or configure "File History" to use a network share. Now, all your changes to any files in Google Drive will also be in File History. If you want them in the cloud, then you can copy the "File History" repository to the cloud. Now you not only have a backup, but you have multiple copies at multiple times, and you should be able to always recover, even if someone accidentally deletes a folder they are sharing with you.

  • (*) Note that in Windows 8.1, there are NO LONGER any visible "libraries", but they are still there and do still exist. So, do a Google search if you can't figure out where they are or how to create or find a "Windows Library" in 8.1.

  • (**) Libraries typically contain more than one folder. Windows 8.0-8.1 File History, and Windows 10 "mis-named" "Previous Versions" will back up every new copy of every file or folder as they are created and changed, but only about every 10-15 minutes (there's a setting for frequency). The problem is, although all of the sub-folders contained will keep the files where they should be, separately. But, in the root of that library, ALL the files in the roots of all the folders that make up that library are all thrown together, and you can't ever tell which files came from which folders.

There are other solutions that also will copy all the Google created docs. Perhaps I will also work on a DIY solution for this problem.


If you are using a Google Apps for BUSINESS, either paid or not, you can ask your admin to recover any Files, folders or GMail, AFTER they are deleted from your Google Drive and the trash folder is emptied.

If you are using a PERSONAL Google Apps / Drive account, then you can ask Google to recover any files, folders or GMail, BY HAND, and here's how: Recover Deleted files or folders after trash is emptied

If you are the admin, (or personal account) here's how to recover a users' Files, folders or GMail, but only under the following conditions:

  • The owner's user account hasn't been deleted
  • Files, folders or GMail were deleted less than 25 days ago
  • Files, folders or GMail are NOT still in the user's Trash folder
  • Files, folders or GMail are recovered only to whoever OWNED those Files, folders or GMail
  • Files, folders or GMail are restored to that user ONLY, and not to anyone that the Files, folders or GMail was shared with
  • NONE of the SHARED permissions to these Files, folders or GMail are restored, so after restoring, the user would have to RECREATE the shares, and then ensure these "shares" have been restored separately, after recovery.

Here's how to recover user's files, folders or GMAIL:

If you are the admin:

  • Make sure the user doesn't have it in the trash and
  • Thinks it was deleted within the last 25 days.
  • After recovery,
  • .... make sure the user has restored his shares permissions
  • .... and the shared Files, folders or GMail are available to those shared users.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.