Yet another way to restore versions in bulk

After restoring my Syncthing setup from a backup on a fresh Android—without copying over the actual synced folders—Syncthing removed all files from my laptop. Fortunately I had versioning turned on for all folders, so nothing was lost. After some searching I found two ways to easily restore versions for thousands of files:

I’ve worked out yet another way, through the web interface:

  1. Click on the folder you’d like to restore versions for.

  2. Click “Versions”.

  3. Run this jQuery in your developer console to select the second option of every dropdown in this modal—which happens to be latest version:

    $(’#restoreVersions ul.dropdown-menu li:nth-child(2) a’).click()

  4. Go grab a cup of coffee, this might take a while, depending on how long the list is.

  5. Click “Restore” at the bottom of the list.

I can’t guarantee that this selector will always work, but it did today and for me.

Good luck.


PS I’ve seen this post, but it did not include the actual jQuery.