git rebase, 😎 --> 😱
Rishi

Rishi @rishiabee

About: Computer Science is evolving so fast... I'm eternally a student. Here're some of my notes.

Location:
Mauritius
Joined:
May 11, 2019

git rebase, 😎 --> 😱

Publish Date: May 6 '20
29 1

You keyed in git rebase , and pressed Enter like a 😎.

Then everything looks ...🔥... not exactly the same as you expected it.
🍒 you realised that you didn't push ⛅ any of your recent work and you're at a point of no return! 💨

😮

😨

😱

😰

😩

🙈

PANIC


💡

Here's a solution

Use git reflog - Manage reflog information.

  1. In the terminal, type in git reflog.
    You'll see a list of all recent commits.

  2. Pick the one which you worked last.
    In my case, commit 29b5617 was the one I needed to go back to.
    git reset --hard 29b5617

    Alternatively, git reset --hard HEAD@{17} would have worked exactly the same.


Let the rest know how you've survived an unwanted git rebase by leaving a comment.

Comments 1 total

Add comment