Suppose I have a file a.txt
. One day, I deleted it, committed, and pushed.
The next day, I wanted like to revert the last commit, bringing back a.txt
. I tried using git revert
, but when I did git blame
, all lines are showing the revert commit hash. The original blame history is lost.
Can I recover the file and preserve the file history, i.e., as if the file has not been deleted before? Note that I must not change the history as the commit has been pushed.
Thanks!