Git restore file

In this article let’s discuss about Git restore file. Let’s go through the following methods without any delay.

Method 1:

git restore --source=c5f567 file1/to/restore file2/to/restore # restore files to how they were in the commit with the hash listed in --source

If you are facing any issues with the above approach then try the alternative that is given below. It may look similar by have a try!

Method 2 :

git checkout HEAD -- my-file.txt

Hope the above solution works.

Realted Posts : How to install nvm on linux terminal