I committed by data using git commit -m, followed by git pull and found there is an overwrite by different team, In order to solve it I ran a git reset --hard and few other commands, but I messed up everything and lost my commit. Is there a way I can rollback to my last commit.
Asked
Active
Viewed 53 times
-1
-
1Possible duplicate of [How can I undo git reset --hard HEAD~1?](http://stackoverflow.com/questions/5473/how-can-i-undo-git-reset-hard-head1) – Jeff Puckett Oct 21 '16 at 01:40
2 Answers
1
It is not clear from your question what you did exactly. But if nothing else works, I'd try git reflog. Since you commited your changes before git pull, reflog should be able to give you the commit hash of your head before you performed the git pull.
Shakkhar
- 189
- 9
-
1
-
1Been there :) Please mark the answer as correct if it solved the problem. – Shakkhar Oct 21 '16 at 00:52
0
You can try resetting to a particular commit point immediately before you pulled your team's code if you know the commit hash
The attached link should be useful to you https://stackoverflow.com/a/12049323/1592471
Community
- 1
- 1
Leye Odumuyiwa
- 654
- 7
- 9