git stashの基本
stashコマンドは変更を一時的にしまっておけるコマンド。
$ git stash         # 変更をスタックにプッシュする
$ git stash list    # スタックにある変更を一覧表示する
$ git stash drop    # スタックの一番上にある変更を削除する
$ git stash pop     # スタックから変更を一つポップする
スタックにある変更差分を確認したい時
git stash listでstash@{N}の番号を確認する。
$ git stash list
stash@{0}: WIP on branch_name: commit_id2 commit_comment2
stash@{1}: WIP on branch_name: commit_id1 commit_comment1
中身を見たい番号を指定して、以下のコマンドでHEADとの差分を確認できる。
$ git diff stash@{0}
ファイル指定もできる。
$ git diff stash@{0} hoge.txt