git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Retrieving a file in git that was deleted and committed
@ 2018-12-07  6:49 biswaranjan panda
  2018-12-07  6:55 ` Bryan Turner
  2018-12-10 15:12 ` Sergey Organov
  0 siblings, 2 replies; 12+ messages in thread
From: biswaranjan panda @ 2018-12-07  6:49 UTC (permalink / raw)
  To: git

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

While this does gets the file back, the file shows up as a new file to
be committed. Once I commit it, git blame doesn't show the old history
for the file.

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-12-11  9:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

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