code: def restore(self, chksum, choose_first=False):
          
          log = getLogger('ocrd.workspace_backup.restore')
          bak = None
          candidates = glob(join(self.backup_directory, '%s*' % chksum))
          if not candidates:
              log.error("No backup found: %s" % chksum)
              return
          if len(candidates) > 1 and not choose_first:
              raise Exception("Not unique, could be\n%s" % '\n'.join(candidates))
          bak = candidates[0]
          self.add()
          log.info("Restoring from %s/mets.xml" % bak)
          src = join(bak, 'mets.xml')
          dest = self.workspace.mets_target
          log.debug('cp "%s" "%s"', src, dest)
          copy(src, dest)
          self.workspace.reload_mets()
docs: Restore mets.xml to previous state