-2

I have a few commits and I need to fix my previous commit so I did.

git rebase -i HEAD~2
# change the commit's pick to edit
# ....

How to change the HEAD back to my latest commit?

ca9163d9
  • 27,283
  • 64
  • 210
  • 413
  • 2
    Does this answer your question? [How to reset author of earlier commit?](https://stackoverflow.com/questions/64358024/how-to-reset-author-of-earlier-commit) You were told the answer there but you didn’t do it. – matt Oct 14 '20 at 17:50
  • One question is about update commit and one is about head. – ca9163d9 Oct 14 '20 at 18:05
  • No, the answer about updating the commit told you to continue the rebase but you didn’t. – matt Oct 14 '20 at 18:40
  • Yes, the answer mentioned "let the rebase continue.". But it's unclear for someone new to Git rebase. – ca9163d9 Oct 16 '20 at 16:50

1 Answers1

1

After editing a commit in rebase you need to continue the rebase

git rebase --continue

This will finish the rebase and get you back to commit you were on (well, the rebased version of it)

Dmitrii Smirnov
  • 7,073
  • 1
  • 19
  • 29