LoginSignup
0
0

More than 5 years have passed since last update.

とあるコミットから特定ファイルの変更のみを戻した時のメモ

Last updated at Posted at 2017-12-22

コミットしましたー。

あ、このファイルはマージたくないから戻して〜

分かりましたー

どうするんだろう?

1. 戻したいコミット番号を調べる
git log [ファイルパス]
ex:) git log application/controllers/example.php

2. 戻す
git checkout [コミット番号] [ファイルパス]
ex:) git checkout 392280326ad37636de880dfd671b30d1bdd9c768 application/controllers/example.php

で出来ます。

ちなみに、新規ファイルを消したい場合は

git rm application/controllers/example.php

で出来ます。

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