Answers for "how to restore removed new file which is not in git"

8

git how to not remove a file with git clean

//Remove untracked files
git clean -f

//Remove untracked directories and files
git clean -fd

//Remove untracked ignored files
git clean -fX

//Remove all untracked files 
git clean -fx
Posted by: Guest on June-08-2020
2

git recover deleted file

rm -rf deleted file, if there is any commit before use git commands:
// 1 Find out which comit has the copy of deleted file
git log         
// 2 Use checkout to locate which comit what file location
git checkout branch-number-here -- file/location/in/folder/without/quote
example: git checkout 476c714 -- mvc/public/js/bundle.js
Posted by: Guest on July-16-2020

Code answers related to "how to restore removed new file which is not in git"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language