Manan Patel Manan Patel - 1 month ago 18
Git Question

How to rollback committed data in git

I committed by data using git commit -m, followed by git pull and found there is an overwrite by different team, In order to solve it I ran a git reset --hard and few other commands, but I messed up everything and lost my commit. Is there a way I can rollback to my last commit.

Answer

It is not clear from your question what you did exactly. But if nothing else works, I'd try git reflog. Since you commited your changes before git pull, reflog should be able to give you the commit hash of your head before you performed the git pull.