It notices if your local repo is dirty and asks if you'd like to commit before proceeding with the GPT chat. It will even provide a suggestion for the commit message.
You can run aider with --no-auto-commits if you don't want it to commit to the repo. This is similar to your suggested --dangerous flag.
I have considered various magic/automatic branching strategies. But I suspect they would be too confusing. And people probably have their own preferred git workflows. I feel like it's probably better to let folks explicitly manage their branches and PRs however they like.
My aider tool tries to make this easy by leveraging git. While it automatically commits the edits from GPT, it also provides in-chat commands like /diff and /undo. These commands let you quickly check exactly what edits GPT made, and undo them if they're not correct.
Aider will notify GPT if you /undo its changes, and GPT will probably ask why and then try again with your concerns in mind.
To manage a longer chat that includes a sequence of changes, you can also use your preferred standard git workflows like branches, PRs, etc.