If you erase or change some files accidentaly, you can revert it in two steps
# the files need to be tracked first
git add
.
# then the changes can be undone
git reset
hard