What does a closed branch mean? The Git branch is not closed, at most it is deleted. But it doesn’t matter even if it is deleted, as long as you know that commit exists, just checkout 该 commit 的 sha1 即可以回滚到那里。如果不希望影响当前工作分支,也可以加上 -b name record the rollback in the new branch.
What does a closed branch mean? The Git branch is not closed, at most it is deleted. But it doesn’t matter even if it is deleted, as long as you know that commit exists, just
checkout
该 commit 的 sha1 即可以回滚到那里。如果不希望影响当前工作分支,也可以加上-b name
record the rollback in the new branch.Just use it first
$ git reflog
查看你的历史commit版本号。然后找到你想回退到的某次提交的commit,然后使用git reset --hard commit
, I hope it can help you.