Equivalent of "git reset --hard" with SVN
I would like to revert my SVN central repository, not a w开发者_运维问答orking copy, from revision M to revision N ( M > N ), like a git reset --hard
How can I do that ?
Here you go.
svn revert --recursive .
EDIT
the other answer (https://stackoverflow.com/a/24500425/520162) seems to be a better solution than the one proposed by me. Check that one!
On the client, it's simple:
svn checkout -r <revision> url://path/to/repo
should do it.
If you're on the server (like your edited question says), it depends what you want to achieve.
If you want to throw away all revisions after N
, do a
svnadmin dump -r1:N yourrepo > repo.dump
then, delete the old repo and create a new one
svnadmin create newrepo
svnadmin load newrepo < repo.dump
If you want to keep your repo, check out N
on a client and commit to the server, so that N
is the latest state.
Third one: set up a branch starting from N
and work on that one.
精彩评论