Skip to content
Discussion options

You must be logged in to vote

Yes, if the commits existed on GitHub before the force-push, you can try to recover them using:
git reflog

Find the commit hash before the push and restore it with:
git reset --hard

Then push it back:
git push --force

------>This only works if your local reflog still has the history. If not, contact GitHub Support ASAP — they might help recover lost commits.

Replies: 9 comments 16 replies

Comment options

You must be logged in to vote
3 replies
@Subhamstar
Comment options

@Subhamstar
Comment options

@rulefahd
Comment options

Answer selected by Subhamstar
Comment options

You must be logged in to vote
2 replies
@Subhamstar
Comment options

@Subhamstar
Comment options

Comment options

You must be logged in to vote
1 reply
@Subhamstar
Comment options

Comment options

You must be logged in to vote
4 replies
@Anubhavick
Comment options

@Anubhavick
Comment options

@Subhamstar
Comment options

@Anubhavick
Comment options

Comment options

You must be logged in to vote
3 replies
@Subhamstar
Comment options

@AmanRai8
Comment options

@Subhamstar
Comment options

Comment options

You must be logged in to vote
1 reply
@Subhamstar
Comment options

Comment options

You must be logged in to vote
1 reply
@Subhamstar
Comment options

Comment options

You must be logged in to vote
1 reply
@Subhamstar
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Repositories The core of version-controlled code storage Question Ask and answer questions about GitHub features and usage
9 participants