Retrieve missing files from remote repo?

前端 未结 3 961
被撕碎了的回忆
被撕碎了的回忆 2021-02-14 15:56

I accidentally deleted a few files from my local git repo.

I have not pushed this change to the remote.

Is there a easy way to get these files back from the remo

3条回答
  •  礼貌的吻别
    2021-02-14 16:36

    You should just be able to either revert the commit with the deletions, or reset HEAD to the commit before you did the deletes, depending on whether you want to keep the deletions in the history or not.

    Alternatively, if you haven't committed the deletes yet, you can just checkout the deleted files to restore them from your local repo.

提交回复
热议问题