23
22

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

gitで削除したファイルを復活させる

Posted at

gitで削除したファイルを復活させるコマンドを覚えられないのでメモ

git rev-listで削除したコミットを調べる。

$ git rev-list -n 1 HEAD -- (削除したファイルパス)
3348b8148327353a092d72230feb457737a74338

git checkoutでコミットを指定して復活させる。

$ git checkout 3348b8148327353a092d72230feb457737a74338^ -- (削除したファイルパス)
23
22
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
23
22

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?