Lost all my commits #143388
Replies: 2 comments
-
Git usually keeps a record of these commits locally even after a force push. git reflog 2- Look through the reflog output for the last known good state of your server code. git reset --hard [commit-id] hope that helps |
Beta Was this translation helpful? Give feedback.
-
You may be able to recover your lost commits by following these steps: Check Local Reflog: Run git reflog in your repository. The reflog records all actions on your local branches, including commits, even after a forced push. Look for commit hashes before the force push. Restore from a Commit Hash: Once you find the commit hash for a previous version of your server code: Run git checkout to check out that commit. |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
General
Body
I had to push my newly created folder(react)-client, though i had several commits of backend codes-server. In doing so i couldn't push so i used the force command and lost all commits and history of my server codes. Please i need assistance to help me recover all my commits lost. Thank you.
Beta Was this translation helpful? Give feedback.
All reactions