Search code examples
gitbackup

How to get deleted files back with git pull?


I had up to date repository. Then I had deleted several files and this was mistake. I would like to get fresh repository back. I do

$ git pull origin master

And expect to get everything from server, but getting message that everything is up to date.

How to get my sources from server using git pull then?


Solution

  • You can reset local branch to what's at remote

    git reset --hard origin/main