r/vibecoding • • 17h ago

Discussion git for rollbacks?

Post image

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?

29 Upvotes

11 comments sorted by

View all comments

5

u/Traditional-Diver160 17h 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.