I make a change and then I git stash
and then I git stash apply
My question is
why after I git stash apply
I think that something may be wrong in your configuration as while git stash
records the state of the index and the working tree before resetting to the latest commit, git stash apply
should only attempt to restore the state of the index if you use the --index
option.
One possible point of confusion is that if you have conflict (i.e. there are merge conflicts introduced because the stash is being applied to a different commit where the files affected by the stash have been changed since the commit at which the stash was made), then if you use mergetool
to resolve the conflicts, mergetool
will automatically stage changes to the files on a successful resolution.
As Greg Hewgill states a simple reset will unstage all staged changes.
git reset