git reset --soft
新しいブランチをポイントするためにを行うことができますが、HEAD
すべてのファイル(新しいブランチで変更されたファイルを含む)はそのままにしておきます。次にgit checkout
、新しいブランチから本当に必要なファイルだけをチェックアウトするために使用できます。
git reset [<mode>] [<commit>]
This form resets the current branch head to <commit> and possibly updates the index (resetting it to the
tree of <commit>) and the working tree depending on <mode>. If <mode> is omitted, defaults to --mixed.
The <mode> must be one of the following:
--soft
Does not touch the index file or the working tree at all (but resets the head to <commit>, just like
all modes do). This leaves all your changed files "Changes to be committed", as git status would put
it.