0

I have project.zip file which we commit in git. I made few changes in that zip contents and uploaded it in git repository. After that 2 commits were made. Now I need the zip file which I uploaded 2 commits before. Please help how can I download it. I tried using the below command, but it didn't work.

git cat-file <commit-hash>:./<file name> > aa.zip
Dom
  • 1,687
  • 6
  • 27
  • 37
user3875464
  • 121
  • 9

1 Answers1

0
  1. Use git log to find the commit hash where the file has the contents you're interested in
  2. git checkout {hash that you found}
  3. the copy of the zip-file available on the filesystem is the one you're looking for (:
daf
  • 1,289
  • 11
  • 16
  • Ya I tried this. But is there any way without chekout method? – user3875464 Jun 30 '16 at 14:22
  • http://stackoverflow.com/questions/610208/how-to-retrieve-a-single-file-from-specific-revision-in-git looks like it answers that question. – daf Jun 30 '16 at 14:33
  • Your link gave me the answer. I used the below command as solution: `git checkout [branch | revision] filepath ` – user3875464 Jul 01 '16 at 06:52