It’s a feature of the ide but pretty much all of them have an option for ais to only change code via a merge and review process. It’s not the ai changing directly, it’s heres a diff; accept, change, discard process after the prompt. Past there the ides usually have a local history and yiu can also use git.