Why not the [official guide](http://git-scm.com/book/en/Git-Tools-Rewriting-History)?