r/vibecoding • • 5d 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?

35 Upvotes

12 comments sorted by

View all comments

7

u/Traditional-Diver160 5d 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/Pellow_Jaliea 4d ago

git diff is nice alongside those too since it shows what the agent actually touched before deciding whether to nuke it.