Git - deleted some files locally, how do I get them from a remote repository

前端 未结 6 1247
星月不相逢
星月不相逢 2020-12-22 20:42

I\'ve deleted some files on my PC, how do I download them again?

Pull says: \"Already up-to-date\".

6条回答
  •  温柔的废话
    2020-12-22 21:04

    If you deleted multiple files locally and did not commit the changes, go to your local repository path, open the git shell and type.

    $ git checkout HEAD .
    

    All the deleted files before the last commit will be recovered.

    Adding "." will recover all the deleted the files in the current repository, to their respective paths.

    For more details checkout the documentation.

提交回复
热议问题