Lost my github repo branch #5404
Unanswered
Vipul-Bhardwaj777
asked this question in
General
Replies: 1 comment
-
If you have only pushed a single commit, you can do the following: git checkout master git reset --hard HEAD~ git push -f This will restore master to the previous commit. If you made more commits, you can replace HEAD~ with any other commits (a SHA1 hash, a branch name, a tag name, etc.). Resources:
Good luck |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I force-pushed a commit on my GitHub repo using ( git push -f --set-upstream origin master) and now except for that commit, the whole repository is gone.
It's empty now, only the new commit is visible
Is there any way to get back my work🥺
I
Beta Was this translation helpful? Give feedback.
All reactions