I would like to revert my SVN central repository, not a working copy, from revision M to revision N ( M > N ), like a git reset --hard
How can I do that ?
First, it's always worth noting that git reset --hard is a potentially dangerous command, since it throws away all your uncommitted changes. For safety, you should always check that the output of git status is clean (that is, empty) before using it.
Git SVN is a feature in Git that allows changes to move between a Subversion and a Git repository. Git SVN is a good feature to use if you need to allow changes to go between Git and SVN repositories.
Summary. To review, git reset is a powerful command that is used to undo local changes to the state of a Git repo. Git reset operates on "The Three Trees of Git". These trees are the Commit History ( HEAD ), the Staging Index, and the Working Directory.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With