GIT代码临时回到以前的状态

Git: Temporarily revert to previous commit

If you want to go back to a previous commit, while keeping all of your other history, simply checkout that commit.

COPY
git checkout <sha-1 of that commit>

This will put you in a detached state, where you're not checked out in any branch. To go back, simply checkout a brach. You can use the shortcut git checkout - (that's a dash) to go back to your previous checkout :)

posted @ 2019-11-20 14:16  andy_0212  阅读(224)  评论(0编辑  收藏  举报