使用git如何回滚到一个已经关闭的分支的某次提交?
怪我咯
怪我咯 2017-04-26 09:01:52
0
2
647

使用git如何回滚到一个已经关闭的分支的某次提交?

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(2)
伊谢尔伦

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template