LoginSignup
12
11

More than 5 years have passed since last update.

git checkoutで特定のファイルをチェックアウトする

Last updated at Posted at 2016-07-10

何かの手違いで管理対象のファイルを失ってしまった場合、
そのファイルだけ取得することができる。

HEADのファイルも取得できるし、ある時点のファイルも取得できる。

git checkout コミットID file_path

ディレクトリのパスを指定すると、そのディレクトリ配下のファイルを全てチェックアウトすることもできる。

git checkout コミットID directory_path

仕事でやらかしてしまった時は落ち着いて復元しよう。

12
11
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
12
11