LoginSignup
0
0

More than 3 years have passed since last update.

ブランチを切って過去のコミットを取り入れる方法

Posted at

前提

・現在masterブランチにいる。
・masterブランチには最新のコミットをpush済み。
・テストが通らなくなったので怪しいコミットの部分まで遡りたい。

$  git log   #戻りたいコミットIDをコピーする

$  git checkout -b testbranch   #masterブランチから検証用のブランチを作成

$  git reset --hard #戻りたいコミットID

$  git log  #過去の怪しいコミットに戻れているか確認。

念の為ローカルのファイルにも反映されているか目視で確認しましょう。

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