美文网首页
如何找回git push、git push之前的文件

如何找回git push、git push之前的文件

作者: 文朝明 | 来源:发表于2019-12-28 16:08 被阅读0次
    git reflog
    

    之后会出现相关记录

    47596da (HEAD -> master, origin/master, origin/index-swiper, origin/HEAD, index-swiper, header) HEAD@{0}: checkout: moving from 214ce02c3aa543b2ef6c667a3f267a8a588ab3c4 to master
    214ce02 HEAD@{1}: commit: add header
    47596da (HEAD -> master, origin/master, origin/index-swiper, origin/HEAD, index-swiper, header) HEAD@{2}: checkout: moving from index-swiper to origin/master
    47596da (HEAD -> master, origin/master, origin/index-swiper, origin/HEAD, index-swiper, header) HEAD@{3}: checkout: moving from index-swiper to index-swiper
    47596da (HEAD -> master, origin/master, origin/index-swiper, origin/HEAD, index-swiper, header) HEAD@{4}: checkout: moving from 47596daf1c1c4749295b6840f3649dcb78938f31 to index-swiper
    47596da (HEAD -> master, origin/master, origin/index-swiper, origin/HEAD, index-swiper, header) HEAD@{5}: checkout: moving from head to origin/master
    596e77c HEAD@{6}: commit (initial): 'header'
    47596da (HEAD -> master, origin/master, origin/index-swiper, origin/HEAD, index-swiper, header) HEAD@{7}: checkout: moving from header to head
    47596da (HEAD -> master, origin/master, origin/index-swiper, origin/HEAD, index-swiper, header) HEAD@{8}: checkout: moving from master to header
    47596da (HEAD -> master, origin/master, origin/index-swiper, origin/HEAD, index-swiper, header) HEAD@{9}: commit: project init
    08ea728 HEAD@{10}: commit: project initialized
    f476e3e HEAD@{11}: clone: from git@gitee.com:xxx/xx.git
    
    
    git reset HEAD@{5}
    
    Unstaged changes after reset:
    M       src/main.js
    M       src/pages/home/home.vue
    

    就可以了

    相关文章

      网友评论

          本文标题:如何找回git push、git push之前的文件

          本文链接:https://www.haomeiwen.com/subject/tspsoctx.html