I came to this question looking to restoreIf you deleted a file I just deletedthat was tracked in the previous commit, but I hadn'tdidn't yet committedcommit the change. Just in case you find yourself in this situationdeletion, all you need to do is the followingcan restore it using:
git checkout HEAD -- path/to/file.ext
git checkout HEAD -- path/to/file.ext
I came to this question looking to restore a file I just deleted but I hadn't yet committed the change. Just in case you find yourself in this situation, all you need to do is the following:
git checkout HEAD -- path/to/file.ext
If you deleted a file that was tracked in the previous commit, but didn't yet commit the deletion, you can restore it using:
I came to this question looking to restore a file I just deleted but I hadn't yet committed the change. Just in case you find yourself in this situation, all you need to do is the following: