Git checkout doesn’t touch your database. But the moment your feature spans both schema and code, that’s a problem. You switch branches and your migrations are out of sync. Queries fail. Tests break. The environment you thought was stable starts to bleed errors.
Most teams hack around this with local scripts or manual resets. It’s brittle. You check out a branch, run migrations, maybe seed data. Then you go back to main—revert migrations, re-seed. Each step burns minutes and introduces errors. On a big repo with dozens of branches in motion, these context switches compound.
A cleaner pattern is to pair git checkout with database state that follows your branch. Local-only databases can’t do that well. Centralized databases shared across branches make it worse—schema drift hits everyone at once. The right move is isolated, per-branch databases built automatically when you switch.