git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Sergey Organov <sorganov@gmail.com>
To: biswaranjan panda <biswaranjan.nitrkl@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Retrieving a file in git that was deleted and committed
Date: Mon, 10 Dec 2018 18:12:06 +0300	[thread overview]
Message-ID: <87sgz58lh5.fsf@javad.com> (raw)
In-Reply-To: <CADHAf1Y_d=-9By4jC2xd+BmWJgfGmBNUr=uSuQtfuHDrarN4kw@mail.gmail.com> (biswaranjan panda's message of "Thu, 6 Dec 2018 22:49:23 -0800")

biswaranjan panda <biswaranjan.nitrkl@gmail.com> writes:

> 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.

[...]

> I would appreciate if anyone knows how to preserve git blame history.

Provided you deleted the file by mistake and you didn't yet publish the
history, just rewrite the history, fixing the commit that deleted the
file. "git rebase -i" is a suitable way to do it.

-- Sergey

      parent reply	other threads:[~2018-12-10 15:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-07  6:49 Retrieving a file in git that was deleted and committed biswaranjan panda
2018-12-07  6:55 ` Bryan Turner
2018-12-07  7:07   ` biswaranjan panda
2018-12-07  7:20     ` Jeff King
2018-12-07  7:37       ` Bryan Turner
2018-12-07 21:50         ` biswaranjan panda
2018-12-08  7:29           ` Jeff King
2018-12-09  0:07             ` biswaranjan panda
2018-12-11  1:19             ` Junio C Hamano
2018-12-10 21:33       ` Elijah Newren
2018-12-11  9:46         ` Jeff King
2018-12-10 15:12 ` Sergey Organov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sgz58lh5.fsf@javad.com \
    --to=sorganov@gmail.com \
    --cc=biswaranjan.nitrkl@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).