[enh] Make restore script standalone