Git - 从本地和远程恢复已删除的分支

时间:2022-06-19 00:02:56

Can I get my deleted git branch back, I deleted it from local and remote repository.

我可以将我删除的git分支恢复,我从本地和远程存储库中删除它。

1 个解决方案

#1


1  

Run git reflog to find the sha1 of the commit that was on the top of your deleted branch, then just run git checkout -b <branch> <sha1> and you're all set.

运行git reflog以找到已删除分支顶部的提交的sha1,然后运行git checkout -b 并完成所有设置。

#1


1  

Run git reflog to find the sha1 of the commit that was on the top of your deleted branch, then just run git checkout -b <branch> <sha1> and you're all set.

运行git reflog以找到已删除分支顶部的提交的sha1,然后运行git checkout -b 并完成所有设置。