1

I want to be able to revert 1 file when using GIT [w/Visual Studio]. So for example a file is deleted on the local drive [but still listed in the Solution/Project]. I want to be able essentially right-click the file in the VS Proj and do a, "Get Latest". I've seen this sort of functionality in other SCCS. Is there a set of GIT commands to do this? I do NOT want all the files just a specified one.

Stu
  • 77
  • 5
  • Possible duplicate of [Find and restore a deleted file in a Git repository](https://stackoverflow.com/questions/953481/find-and-restore-a-deleted-file-in-a-git-repository) – Nasreddine Dec 02 '17 at 19:45
  • Did the answer help you solve the problem? If yes, you can mark it as answer. And it will help others who have similar questions. – Marina Liu Dec 12 '17 at 09:00

1 Answers1

0

Since what you deleted on local dirve but still shows in VS are the changes not staged for commit, so any one of the below commands can work:

git checkout -- .
git reset --hard HEAD
Marina Liu
  • 36,876
  • 5
  • 61
  • 74