Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git find when file was deleted

git log --full-history -- your_file
Comment

remove git deleted files

git add .  => Add all (tracked and modified)/new files in the working tree.

git add -u => Add all modified/removed files which are tracked.

git add -A => Add all (tracked and modified)/(tracked and removed)/new files in the working tree.

git commit -a -m "commit message" - Add and commit modified/removed files which are tracked.
Comment

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 
Comment

remove git deleted files

git add -u
Comment

git-recover-deleted-file

$ git checkout <deletion commit hash>~1 -- <filename>
Comment

Git Restoring Deleted Files

$ git checkout <commit hash> -- <filename>
Comment

remove git deleted files

git commit -m "Deleted files manually"
Comment

PREVIOUS NEXT
Code Example
Shell :: start docker image 
Shell :: wsl2 
Shell :: store environment variables firebase functions 
Shell :: cmd run exe as service 
Shell :: undo git commit after push 
Shell :: delete a git branch 
Shell :: .gitignore add directory 
Shell :: installing flutter_native_splash 
Shell :: copy to clipboard while ssh into another terminal 
Shell :: connect terminal to server 
Shell :: uname -r command 
Shell :: sed add newline 
Shell :: how to delete an issue on github 
Shell :: dns_probe_finished_nxdomain ubuntu 
Shell :: git pull branch you are not on 
Shell :: how to copy a file in ubuntu 
Shell :: download docker linux 
Shell :: how to update kali linux 2022 
Shell :: install docker on linux 
Shell :: cor installation 
Shell :: git list files only upto 1-levels 
Shell :: go install 
Shell :: libsound2-dev missing 
Shell :: shortan promt ubunto 
Shell :: recursively replace : to _ in file names linux 
Shell :: install next-auth 
Shell :: node installation error authenticated user is not valid 
Shell :: colcon build number of threads 
Shell :: how to active telnet on windows 10 telnet 
Shell :: i am not able to start bluetooth in ubantu 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =