Put OSX under version control
You can create APFS snapshots of your disk using tmutil.

tmutil localsnapshot


I am not aware of how long these snapshots are kept for. They are marked as purgeable space so macOS can remove them at will. There may be a way to mark snapshots to be kept without being automatically removed.

You can list existing snapshots with

tmutil listlocalsnapshots /


These snapshots can be restored from Recovery:


  


Screenshot from https://derflounder.wordpress.com/2017/11/02/apple-software-updates-creating-apfs-snapshots-on-macos-high-sierra/ which has more details about how macOS creates snapshots automatically on macOS updates.