Versioning of automations and scripts

how do you guy keep track of versions/updates on automations/scripts/…?
do you push to github every time you make a bigger change? do you have some local versioning system? do you create a copy of every automation before tinkering?

I’m asking because I listened too much too the LLM; created a monster that is too complex for me. And now I’d like to return.

By copying files or parts of files from backups. Mandatory encryption of backups in the new system makes this a lot more difficult, if you’ve moved to the new system.