r/vibecoding • u/Royal-Marsupial-8110 • 2h ago
Discussion git for rollbacks?
i've never really learned proper dev workflows, so my current backup strategy is literally copying the whole folder before every big prompt. had codex hooked to sumus earlier and still ended up with 5 backup folders on my desktop cuz i was scared to touch a working navbar.
is basic git worth learning just for local rollbacks? or do yall rely on editor checkpoints and pray?
5
Upvotes
1
u/SeasawPhilosopher 1h ago
Just tell codex to use git for your projects
1
u/Traditional-Diver160 1h ago
Yes, and for local rollbacks you need about four commands, not all of git.
git init - once per project.
git add -A && git commit -m "navbar works" - this replaces copying the folder.
git restore . - throws away everything changed since the last commit. Files the agent newly created stay, git clean -fd removes those too, so look before you run it.
git log --oneline and then git reset --hard <id> - to go back further than the last commit.
Commit before every big prompt and right after anything that works. Editor checkpoints are fine for undoing the last step, but a commit does not depend on the editor or the agent session.
1
u/hieuphung97 25m ago
Folder copies eat up gigabytes once dependencies get involved. You only need `git diff` and `git checkout -- .` to survive. Seeing the exact ten lines the model butchered saves you from starting the entire prompt over.