I have an old commit that I did a few weeks ago. I want to restore only a single file from that commit. What do I do?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This will not alter HEAD, it will just overwrite the local file
path/to/file.txtSee man git-rev-parse for possible revision specifications there (of course a simple hash (like
dd9bacb) will do nicely)Don’t forget to commit the change (after a review…)