Fail-safe method to revert change in Linux