For fixing the Enterprise, it made sense. They effectively wiped the hard drive and reverted back to a factory install using the restore partition, much like you would do to a PC that's full of malware.
Now for Data? He keeps a backup of himself in himself that will automatically take over when he "dies". That's less convincing.