0

I was working on a branch, after I commited my changes and tried to push them it said that I had diverged and needed to pull the most recent changes.

I did git pull --rebase which caused an rebase conflict. I couldt identify where the problem was. So I did git rebase --skip which seems to have reverted my changes to a version that is behind my commit.

Is it possible to reset to my commit that I tried to push? I did git reflog to find the commit ID. And then I tried git reset *commitID* But it does not seem to work. It does not reset. What can I do?

mrfr
  • 1,724
  • 2
  • 23
  • 44
  • Possible duplicate of [How to revert Git repository to a previous commit?](https://stackoverflow.com/questions/4114095/how-to-revert-git-repository-to-a-previous-commit) – JDB Nov 15 '17 at 17:22

1 Answers1

0

I did a git reset --hard *comitID*. Still dont know why a "normal" reset didnt work.

mrfr
  • 1,724
  • 2
  • 23
  • 44
  • 2
    You can learn more about git reset at https://stackoverflow.com/a/2530073/20371 . In particular, a 'normal' reset didn't change your working files because that's the intended behaviour of git, to avoid overwriting people's work. If you're _sure_ you want to, you would use `git reset --hard COMMIT`. – Yawar Nov 15 '17 at 14:29
  • I concur: what you call "normal" reset implies the `--mixed` command-line option, which is documented. – kostix Nov 15 '17 at 14:33