Re: Retrieving a file in git that was deleted and committed

2018-12-07 Thread Jeff King
On Fri, Dec 07, 2018 at 01:50:57PM -0800, biswaranjan panda wrote: > Thanks Jeff and Bryan! However, I am curious that if there were a way > to tell git blame to skip a commit (the one which added the file again > and maybe the one which deleted it originally) while it walks back > through

Re: Retrieving a file in git that was deleted and committed

2018-12-07 Thread biswaranjan panda
On Thu, Dec 6, 2018 at 11:26 PM Jeff King wrote: >> >> On Thu, Dec 06, 2018 at 11:07:00PM -0800, biswaranjan panda wrote: >> > >> Thanks! Strangely git log --follow does work. >> >> I suspect it would work even without --follow. When you limit a log >> traversal with a pathspec, like: >> >> git

Re: Retrieving a file in git that was deleted and committed

2018-12-06 Thread Bryan Turner
On Thu, Dec 6, 2018 at 11:26 PM Jeff King wrote: > > On Thu, Dec 06, 2018 at 11:07:00PM -0800, biswaranjan panda wrote: > > > Thanks! Strangely git log --follow does work. > > I suspect it would work even without --follow. When you limit a log > traversal with a pathspec, like: > > git log foo

Re: Retrieving a file in git that was deleted and committed

2018-12-06 Thread Jeff King
On Thu, Dec 06, 2018 at 11:07:00PM -0800, biswaranjan panda wrote: > Thanks! Strangely git log --follow does work. I suspect it would work even without --follow. When you limit a log traversal with a pathspec, like: git log foo that is not about following some continuous stream of content,

Re: Retrieving a file in git that was deleted and committed

2018-12-06 Thread biswaranjan panda
Thanks! Strangely git log --follow does work. On Thu, Dec 6, 2018 at 10:55 PM Bryan Turner wrote: > > On Thu, Dec 6, 2018 at 10:49 PM biswaranjan panda > wrote: > > > > I have the following scenario: > > > > On a branch A, I deleted a file foo.txt and committed the change. Then > > I did a bunch

Re: Retrieving a file in git that was deleted and committed

2018-12-06 Thread Bryan Turner
On Thu, Dec 6, 2018 at 10:49 PM biswaranjan panda wrote: > > I have the following scenario: > > On a branch A, I deleted a file foo.txt and committed the change. Then > I did a bunch of other changes. > Now I want to undelete foo.txt. > > One way is to checkout a separate branch B where the file

Retrieving a file in git that was deleted and committed

2018-12-06 Thread biswaranjan panda
I have the following scenario: On a branch A, I deleted a file foo.txt and committed the change. Then I did a bunch of other changes. Now I want to undelete foo.txt. One way is to checkout a separate branch B where the file is present. Then checkout A. Then do git checkout B -- path_to_file