sg: Add `migration rewrite` command
Created by: efritz
Partial fix to https://github.com/sourcegraph/sourcegraph/issues/39863. This PR adds an sg migration rewrite
command that resets the migrations on-disk of your clone to the canonical version at the given git revision.
Test plan
Tested by hand locally.