Recover accidentally deleted files by git reset hard 1

Recover accidentally deleted files by git reset hard

git fetch --all
git reset --hard origin/{{your branch name}}

Here is what the above code is Doing:
1. git fetch –all
– This will fetch all the branches from the remote repository.
2. git reset –hard origin/{{your branch name}}
– This will reset your current branch to the state of the remote branch.

Similar Posts