How to get deleted files back with git pull?

This shows all the deleted files.

git ls-files --deleted 

This will restore the deleted file.

git checkout <deleted file name with complete path>

The files are in your local git history so you won't need to pull code to get them back. Run

git checkout <file>

on the missing files. If you don't have any uncommited changes then

git checkout .

in the git root directory will work as well.


You can reset local branch to what's at remote

git reset --hard origin/main

Tags:

Git

Backup