DEV Community

Discussion on: A closer look at git rebase

Collapse
 
tmr232 profile image
Tamir Bahar

Just remember to always git branch backup before you rebase. Then, after the rebase, you can git diff backup to make sure it went well. If something does go awry, you can just git reset --hard backup and start over.

Collapse
 
obscuren profile image
Jeffrey Wilcke

There's no need to create a backup branch. You can do git diff HEAD@{N}~range and git reset --hard HEAD@{N}. Also see git reflog

Collapse
 
tmr232 profile image
Tamir Bahar

I agree. But from my experience, people just learning how to rebase really don't want to know anything about git reflog.
The branch method is simpler for beginners.