Updating to macOS Mojave

Will updating to a new OS replace and system files that I may have accidental tampered with that has since cause the system to run unstable. For example,I’m currently running OS X Sierra I’m now updating to macOS Mojave.