我的硬盘上有一个git存储库,但不得不更换我的硬盘并丢失了我的存储库。我在GitHub上有存储库,而且我曾经在本地存储库中使用git push origin master
。
如何从GitHub取回我的存储库并回到原来的位置?
答案 0 :(得分:3)
您可以简单地clone the repository,然后您将返回上一个推送版本:
git clone https://github.com/username/repository.git
默认情况下,将检出主分支。
答案 1 :(得分:1)
使用git clone:如果您有任何未推送的本地更改,它们将会消失。
http://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository