Correctly restore the `index.html` files when purging script folders