git checkout previous commit without detached head