Quantcast
Channel: Undoing a git rebase - Stack Overflow
Viewing all articles
Browse latest Browse all 23

Answer by Andrew for Undoing a git rebase

$
0
0

For newbies/anyone too scared of doing a hard reset, you could checkout the commit from the reflog, and then save it as a new branch.

git reflog

Find the commit just before you started rebasing. You may need to scroll further down to find it (press Enter or PageDown). Take note of the HEAD number and replace 57:

git checkout HEAD@{57}

Review the branch/commits, if it looks good create a new branch using this HEAD:

git checkout -b new_branch_name

Viewing all articles
Browse latest Browse all 23

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>