Temporarily switch working copy to a specific Git commit
问题 How to switch to specific Git commit without losing all the commits made after it ? I want that local files will be changed, but commits' database will remain intact, only the current position pointer is set to currently selected commit. I want to change files' state to specific commit, run project and, when finished, restore files back to last commit. How to do this without zipping the whole project's folder? 回答1: If you are at a certain branch mybranch , just go ahead and git checkout