I deleted a commit accidentally using:
git reset --hard HEAD~1
I want to know if there is a way I can revert this and recover my commit. Thanks for your help.
I deleted a commit accidentally using:
git reset --hard HEAD~1
I want to know if there is a way I can revert this and recover my commit. Thanks for your help.
Ho I find the answer! I did not knew I can use git reflog
it will show your all your commits included the deleted commits, then you can reset to it like:
git reset HEAD@{N}
Where N
is the number that reflog shows you.