Search code examples
gitgit-rebasegit-resetgit-revert

Undo git pull --rebase


Sorry for bothering everyone! Please help.

I wrongly used the git rebase --hard and overwrite all local files. Then I use git reflog and git reset --hard but did not find the former version! I searched for many questions but it seems that they only deal with git rebase without --hard.

How could I find the deleted files! Thanks!


I checked again and found that I used git pull --rebase. Sorry for misunderstanding.


Command sequences: git stash -> git pull --rebase -> git reset --hard with id (failed) -> git stash apply (succeed)


Solution

  • If you did not use stash to take snapshots before the reset --hard, there is unfortunately nothing you can do to restore your lost working tree.