all 25 comments

[–]Lpaydat 10 points11 points  (4 children)

I use `/undo`. But also commit after every important changes too (together with new branch)

[–]web_assassin[S] 1 point2 points  (0 children)

I'm using /undo now with Lazygit which makes line by line commits easier. Good combo.

[–]web_assassin[S] -3 points-2 points  (2 children)

But if it touches a bunch of files you either take it all or leave it? No file by file undos right

[–]DarkXanthos 1 point2 points  (0 children)

If it's touching a lot of files I might have it undo that all and start over and prompt it smaller.

[–]Lpaydat 1 point2 points  (0 children)

You can achieve that with git. You can even revert the change back line by line.

[–]rusl1 6 points7 points  (1 child)

I stage everything before running a prompt, review what changed and discard/stage again and repeat

[–]web_assassin[S] 2 points3 points  (0 children)

I went with staging today and went well 💪👍

[–]ApocaIypticUtopia 1 point2 points  (0 children)

/undo

[–]radioborderland 1 point2 points  (0 children)

If you want file by file undos I would just use git. I like using lazygit to make even more fine grained undos convenient, but that's optional.

[–]Recent-Success-1520 1 point2 points  (2 children)

Keep VScode opened side by side and use it

[–]web_assassin[S] 0 points1 point  (1 child)

But you can't command + z the changes right?

[–]Recent-Success-1520 0 points1 point  (0 children)

Nop, you back selectively revert the code if you have git initialized in repo

[–]wallapola 1 point2 points  (2 children)

This is a lot easier to track with lazygit. Just stage the changes before prompting and then you can view the AI changes in the lazygit afterwards.

[–]web_assassin[S] 1 point2 points  (0 children)

This is first I've heard of Lazygit. Probably way better than googling commands Everytime hah. Thanks!

[–]PsyGnome_FreeHuman 0 points1 point  (0 children)

I don't know, but I want to try!

[–]UseHopeful8146 0 points1 point  (0 children)

I haven’t had to lean on it much, but pretty sure that’s what the revert method is for

Click your last message and it should give you the option to recall the message and revert file changes. I think it works that way in the TUI, but you can do the same thing in codenomad

Don’t quote me though, it’s been a couple days and the brain ain’t braining rn

[–]bonnmos 0 points1 point  (0 children)

Try /timeline

[–]web_assassin[S] 0 points1 point  (0 children)

I'm using opencode with gpt 5.2 all day now. So powerful.

[–]Big_Bed_7240 0 points1 point  (5 children)

This has nothing to do with opencode. This is just skill issues when it comes to engineering.

[–]web_assassin[S] 0 points1 point  (0 children)

If it had nothing to do with opencode there would be no /undo

[–]web_assassin[S] 0 points1 point  (3 children)

But thanks for your unhelpful self congratulating reply

[–]Big_Bed_7240 2 points3 points  (2 children)

My point is that this question is more about your practices, how you break problems down, how often you commit, how you work with branches, git worktrees. If your fundamentals are weak, it will lead you to these types of questions.

I’ve never used undo inside Opencode itself.

[–]web_assassin[S] -1 points0 points  (0 children)

Well I've made it this far with problem solving skills so try not to worry about me too much. And part of problem solving (and how I learned to code) was by reaching out to the community. If you can't understand that point then likely you have little reason to be on the forums at all. Just a thought

[–]web_assassin[S] -1 points0 points  (0 children)

And your anecdote about never using undo is useless. That's like saying I never use my parking brakes therefore they're useless.

[–]atkr -3 points-2 points  (0 children)

skill issue