# as the best wat to revert back 3 commits
git revert HEAD~3
git restore #to restore files from commit
git checkout 12feg3435 #commit ID
#You need to be careful with going back a commit, you could reset your
#branch and loose all of your work.
#safe option:
git checkout <commit-id>
# Go back to the selected commit on your local environment
# Don't forget the . in the end
git checkout <commit-id> .
# Add this version to the staging area and push to remote
git add .
git commit -m "Reverting to <commit-id>"
git push