3 ms·
It was 'git reset --HARD <commit-id>', like a cherry pick, before pushing.
by matheusml 12y ago
It was 'git reset --HARD <commit-id>', like a cherry pick, before pushing.
- X-Istence 12y agogit reflog Might be your saviour here next time.
- matheusml 12y agoI'll update the post. This worked for me. Thanks a lot!
- yuvadam 12y agoIf it was "before pushing" that means the commit has been made, and thus isn't lost (but accessible via the reflog.)
- micampe 12y agoEven with --hard, the commit isn't lost. Commits are not immediately removed from the repository, only when git runs the garbage collection. Try it: create a test commit, make a note of its hash, reset to HEAD~1 and then reset again to that hash. When you do this by mistake and you don't know the hash you can find it using git reflog, which logs everything that happens in the repository. More detailed: http://gitready.com/intermediate/2009/02/09/reflog-your-safety-net.html http://gitready.com/intermediate/2009/02/09/reflog-your-safe...