Is this how to restore to a previous commit and reattach the head to it?
git log git checkout 4bce33d #restore to a previous commit git branch -f master #create new branch at head and force branch name to master git checkout master #attach head to master branch This is only on local repository, there is no remote.
Is there a better way?