Branching off files in case of changes is easy using hard links: Just delete the file that changed by path and put the changed one in place. Hard links point to data, but are independent paths and therefore can be deleted without affecting other hard links or the data itself. The only risky part is writing directly into the file behind a hard link, because this of course would change the data for all hard links pointing to that data, simply because there's only one data for all "the same" hard links available. So you need to know if things have changed and if so need to create a new file.
As you are asking for backup purpose, your problem shouldn't arise anyway: Each change of a file should result in a new file in the backup, without any change you can create hard links to already available data. So your process would need to check for changes first anyway, I don't see where you need to decide if and how you want to change things in the backup. Backup is about leaving everything already present as it is and only decide how to add new things.
In general, I would not recommend implementing such things on your own, it's simply too complex and too easy to get things wrong. There are already solutions available implementing what you have in mind, e.g. a tool called HardlinkBackup.