I know that overlayfs exists, which could enable this sort of thing by capturing each individual change to the filesystem as a new layer. https://www.kernel.org/doc/html/latest/filesystems/overlayfs...
Btrfs and ZFS can do snapshotting, and I would imagine it could be configured to snapshot at certain intervals or after individual changes to the filesystem or a section of the filesystem, like watched directories.
https://wiki.archlinux.org/title/Btrfs#Snapshots
https://docs.oracle.com/cd/E19253-01/819-5461/gbcya/index.ht...
There's also filesystem-in-userland tech like Fuse which could enable something like this. https://www.kernel.org/doc/html/latest/filesystems/fuse.html