Git Ready
操作履歴から復旧する - git reflog の使い方・オプション・サンプル

操作履歴から復旧する- git reflog

HEAD の移動履歴(リフログ)を表示し、誤操作からの復旧に使います。

概念図

git reflog diagram

構文

bash
git reflog [options] [<ref>]

使用例

HEADの移動履歴を表示

bash
git reflog

相対日時付きで表示

bash
git reflog --date=relative

特定ブランチの reflog を表示

bash
git reflog show feature/login

関連コマンド