restore - Restoring git directory while preserving history -


i know can restore removed directory follows

git checkout {revision} -- {dir} 

however, history of files in restored directory gone. seen 'new' files.

is there way restore directory while still preserving files' history?

git tag originalhead # in case git rebase -i <id of parent of commit deleted file> # change pick edit commit git checkout <id of previous commit> <filename> git commit --amend git rebase --continue git tag -d originalhead 

i found here


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -