a bit of a git newcomer and I wanted to make sure I didn't do any big damage to my git repository. Basically, I used git reset --hard HEAD
to revert back to my previous commit as I messed some things up. I then realized I didn't want to lose everything I had done, so I did a git reset HEAD@{1}
. Which didn't seem to do anything helpful. Then I tried a git reset --hard ORIG_HEAD
.
So I figured, whatever, I'll do the little bit of work over. After I did, I went to push it, and I kept getting this error:
Updates were rejected because the tip of your current branch is behind
I tried git pull origin
and it kept not allowing it for a bunch of reasons I can't totally remember.
In the end, I just ended up doing a git push -f
and it seemed to work fine and my project is working well again.
Here's my git reflog
output if it helps:
I'm just curious if I somehow really messed up either my BitBucket repository that I pushed to or my local one in terms of being able to revert back again. Is there any way to check if my git repo is still functioning properly?
EDIT: BitBucket also says I "stripped" a commit...