_restoreLinks(label, type) {
    let cachedManifest = this._readManifest(label, type);
    if (!cachedManifest) {
      return;
    }

    let jsonManifest = JSON.parse(cachedManifest);
    let links = jsonManifest._packageCache.links;

    // Blindly restore links.
    let link, linkPath;
    for (let i = 0; i < links.length; i++) {
      link = links[i];
      if (typeof link === 'string') {
        commands[type].invoke('link', link, { cwd: this.dirs[label] });
      } else {
        linkPath = path.join(this.dirs[label], translate(type, 'path'), link.name);
        fs.mkdirsSync(path.dirname(linkPath)); // Just in case the path doesn't exist.
        symlinkOrCopySync(link.path, linkPath);
      }
    }

    // Restore to original state.
    let keys = Object.keys(jsonManifest._packageCache.originals);
    let key;
    for (let i = 0; i < keys.length; i++) {
      key = keys[i];
      jsonManifest[key] = jsonManifest._packageCache.originals[key];
    }

    // Get rid of the originals.
    delete jsonManifest._packageCache.originals;

    // Serialize back to disk.
    let manifest = JSON.stringify(jsonManifest);
    this._writeManifest(label, type, manifest);
  }
The `_restoreLinks` method restores the dependencies from the internal
`PackageCache` metadata so that the manifest matches its original state after
performing the links.

It is also responsible for restoring these links into the `PackageCache`.

@private
@method _restoreLinks
@param {String} label The label for the cache.
@param {String} type The type of package cache.