Hacker News new | ask | show | jobs
by e12e 3540 days ago
In a vcs it seems natural that rollback is dangerous - it should be the only way to delete work? The only alternative would be to stash what is rolled back in a branch, or somewhere else on disk? At witch point it isn't really a rollback anymore?

Aside from that, I think all major vcs will allow you to clone "up to revision N" which in turn will give you a new repository that has been rolled back to N?

1 comments

Right, but I was talking specifically SQL-like semantics.

Whatever you comitted, you cannot rollback.

Or, say you have some unstaged changes, then accidentally issue a wrong pull or rebase or checkout, then rollback should affect just the pull/rebase/checkout, and get you back to where you had unstaged changes.

So there is no data loss in that scenario, as you can repeat the last command and get exactly the same result.

BTW I am not saying it cannot be done in a regular vcs, its just that it requires different command in different situations, and that obviously causes all kind of problems for many people.