Need Assistance?

support@tutorialshub.in

Undoing Changes and Rewriting History

Interactive rebase

ADVERTISEMENT
Git Free Lesson
5 min read
ADVERTISEMENT

Rebase can clean local commit history

Interactive rebase lets you inspect a sequence of commits and reorder, edit, squash, reword or drop them. It is useful for turning a messy local sequence into a coherent series before review.

Common actions

pick keeps a commit, reword changes its message, edit pauses for changes, squash combines commits while allowing message editing, and drop removes a commit from the rewritten sequence.

Rebase rewrites commit IDs

Because parent relationships change, rebased commits receive new hashes. Use interactive rebase primarily on commits that are not already depended on by other developers.

ADVERTISEMENT