How to undelete a file previously deleted in git's history?

前端 未结 2 1257
情深已故
情深已故 2020-12-08 04:35

Using Chris\'s answer on another question I could prepend a snapshot-history to my git repository. Since one of the files is not part of my history but only in the snapshots

2条回答
  •  情话喂你
    2020-12-08 04:49

    I got it:

    git tag originalHead # just in case
    git rebase -i 
    # change pick to edit for that commit
    git checkout   # thanks for reminding, kubi
    git commit --amend
    git rebase --continue
    git tag -d originalHead
    

    edit unfortunately this will leave all tags at the old timeline, see here

提交回复
热议问题