LOST COMMITS ON SHARED REPO #173547
-
Discussion TypeProduct Feedback Discussion ContentSelect Topic Area General Issues a friend commited our final project to a main branch of a shared repository but then the commits of the other contributors was lost can fast can we recover them |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
HEY @revamper11
Check the commit history Run: git reflogThis will show a list of all recent changes, including commits that might have been overwritten. Find the lost commit Look for the commit hash of the missing contributions. Restore the commit git checkout -b restored-branch <commit-hash>If you want to apply the commit to your current branch: git cherry-pick <commit-hash>Push the restored commit git push origin restored-branch |
Beta Was this translation helpful? Give feedback.
-
Check the commit history Run: git reflogThis will show a list of all recent changes, including commits that might have been overwritten. Find the lost commit Look for the commit hash of the missing contributions. Restore the commit git checkout -b restored-branch <commit-hash>If you want to apply the commit to your current branch: git cherry-pick <commit-hash>Push the restored commit git push origin restored-branch |
Beta Was this translation helpful? Give feedback.
Check the commit history Run:
This wi…