Git restore deleted file - git recover deleted file where no commit was made after the delete

742    Asked by AditiIshii in Salesforce , Asked on Feb 23, 2021
Answered by Aditi Ishii

Try this command:

git reset HEAD cc.properties

Which will unstage the rm command.

Then followed by a

git status

Which shows what you need to do

git checkout -- cc.properties

This command will get the file back

Or you can give this in your config file

git config alias.unstage

reset HEAD

This will unstage a file.



Your Answer

Interviews

Parent Categories