Is it possible to revert my master branch to its initial state if I did a force push on the server with a code that was not up to date? I tried reflog command but it is not working as it keeps track to the local commits only.
Asked
Active
Viewed 4,122 times
2
-
3Cross-site duplicate: [How can I recover from an accidental git push -f?](http://superuser.com/questions/297973/how-can-i-recover-from-an-accidental-git-push-f) gives an answer you can use if you have sufficient access to the remote server. – Jul 13 '15 at 17:07
1 Answers
5
No, if the commit never was on your local repository you cannot resolve this just by yourself.
Ask whoever had pushed what you've overwritten to push force it again (and never never never again push force on branches that other people are using!)

franciscod
- 992
- 4
- 17
-
Is there a way, at least, to find SHA-1 of the latest commit before push? – Laura Jul 13 '15 at 19:23
-
1`git reflog` gives the sha1 for every commit since cloning (except git has done some cleanup, which is rare on small repos) – franciscod Jul 13 '15 at 23:36