第一次stash:> git stash
查询stash 列表:> git stash list 如下:
stash@{0}: WIP on fixResponseType: 8ba2b28 add and change some logic
第二次stash:> git stash
查询stash 列表:> git stash list 如下:
stash@{0}: WIP on emcache: c13f985 Merge pull request #12 from username/fixResponseType
stash@{1}: WIP on fixResponseType: 8ba2b28 add and change some logic
可以看到 stash@{0} 是最新的缓存,stash@{1} 是第一次的stash,所以选择指定的缓存恢复的操作如下:
> git stash pop stash@{1}
这个是恢复第一次的缓存
stash pop 和 apply的区别
pop会从stash里移除对应的缓存,apply则不会