更新时间:2023-12-03 18:20:04
I got it:
git tag originalHead # just in case
git rebase -i <id of the parent of the commit that deleted the file>
# change pick to edit for that commit
git checkout <id of the previous commit> <filename> # 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