git-svn workflows: switch to a specific revision in svn and back to head

8 Feb

first, update to current HEAD:

git svn rebase

then, look for the appropriate hash-name in git corresponding to the svn-revision:

git log | grep -C 5 "my-desired-revision"

switching to the revision is done by a checkout:

git co f914a51a99f09aa609f253fb24a5adcfe0014461

then, do your work, e.g. compiling…
to switch back, clean up the changes caused by your work:

git clean -df
git reset --hard

final step is to switch to the “master” branch, which contains the HEAD revision:

git co master