# finding the commit that deleted a file

4 messages from 2009-04-30 to 2009-04-30. Participants: Christoph Duelli, Alex Riesen, Baz.
Thread: https://gitlist.dev/t/19136

## Christoph Duelli, 2009-04-30 07:31

Subject: finding the commit that deleted a file
Message-ID: <49F953BC.7070303@melosgmbh.de>
URL: https://gitlist.dev/e/49F953BC.7070303%40melosgmbh.de

```
Following scenario:
Some file x was deleted (or renamed, but the --follow option does not 
succeed) some 100 commits ago.
Now, I would like to check the 'lost' contents for some reason.

Is it possible to find out when a given file (path) was deleted?
(And then, with the obtained SHA1, use gitk or some such tool to inspect 
  this file.)

Thank you.

Best regards
-- 
Christoph Duelli

```

## Alex Riesen, 2009-04-30 07:41

Subject: Re: finding the commit that deleted a file
Message-ID: <81b0412b0904300041m2ac646cgdaffd4e2dadb9125@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0904300041m2ac646cgdaffd4e2dadb9125%40mail.gmail.com
In-Reply-To: <49F953BC.7070303@melosgmbh.de>

```
2009/4/30 Christoph Duelli <duelli@melosgmbh.de>:
> Following scenario:
> Some file x was deleted (or renamed, but the --follow option does not
> succeed) some 100 commits ago.
> Now, I would like to check the 'lost' contents for some reason.
>
> Is it possible to find out when a given file (path) was deleted?
> (And then, with the obtained SHA1, use gitk or some such tool to inspect
>  this file.)

"gitk -- the/name/of/deleted/file" :)

```

## Baz, 2009-04-30 08:25

Subject: Re: finding the commit that deleted a file
Message-ID: <2faad3050904300125r6cc6bc1fs6eb0e099dadcbf77@mail.gmail.com>
URL: https://gitlist.dev/e/2faad3050904300125r6cc6bc1fs6eb0e099dadcbf77%40mail.gmail.com
In-Reply-To: <81b0412b0904300041m2ac646cgdaffd4e2dadb9125@mail.gmail.com>

```
2009/4/30 Alex Riesen <raa.lkml@gmail.com>:
> 2009/4/30 Christoph Duelli <duelli@melosgmbh.de>:
>> Following scenario:
>> Some file x was deleted (or renamed, but the --follow option does not
>> succeed) some 100 commits ago.
>> Now, I would like to check the 'lost' contents for some reason.
>>
>> Is it possible to find out when a given file (path) was deleted?

For completeness, the answer to the first part of the question:

git log --diff-filter=D -- the/name/of/deleted/file

>> (And then, with the obtained SHA1, use gitk or some such tool to inspect
>>  this file.)
>
> "gitk -- the/name/of/deleted/file" :)
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

```

## Christoph Duelli, 2009-04-30 08:33

Subject: Re: finding the commit that deleted a file
Message-ID: <49F96261.3060104@melosgmbh.de>
URL: https://gitlist.dev/e/49F96261.3060104%40melosgmbh.de
In-Reply-To: <2faad3050904300125r6cc6bc1fs6eb0e099dadcbf77@mail.gmail.com>

```
Baz schrieb:
> 2009/4/30 Alex Riesen <raa.lkml@gmail.com>:
>> 2009/4/30 Christoph Duelli <duelli@melosgmbh.de>:
>>> Following scenario:
>>> Some file x was deleted (or renamed, but the --follow option does not
>>> succeed) some 100 commits ago.
>>> Now, I would like to check the 'lost' contents for some reason.
>>>
>>> Is it possible to find out when a given file (path) was deleted?
> 
> For completeness, the answer to the first part of the question:
> 
> git log --diff-filter=D -- the/name/of/deleted/file
> 
>>> (And then, with the obtained SHA1, use gitk or some such tool to inspect
>>>  this file.)
>> "gitk -- the/name/of/deleted/file" :)
>> --
Great, thanks.
Both of these work!

Bes regards
-- 
Christoph Duelli

```
