Revert back to a specific commit in git, build, then revert to the latest changes Revert back to a specific commit in git, build, then revert to the latest changes git git

Revert back to a specific commit in git, build, then revert to the latest changes


You could do it like this:

git tag 1.0git add .git commit -m "good stopping point for v1.1"git tag 1.1git checkout 1.0.. do your build stuff/whatevergit checkout 1.1


Your steps are just fine, and you will not lose any work doing it that way. You may want to check out the git stash command to avoid step 2 if you're not really at a good stopping point.