Retrieve lost content in git stash [Personal test, easy to use]

 Copy the following code directly to the terminal and a list of all items will appear, including the stash you deleted/lost.

git log --graph --oneline --decorate  $( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )

 

 The yellow in front is his number

For example, if I want to reply to edit and modify the project, just copy the number and relink it.

git stash apply c3bd9e

 

Guess you like

Origin blog.csdn.net/weixin_44383533/article/details/131857724