Rebase Branch with Reversed Commit Order
Booking.com 👶 Easy Git
Beginner Mode

Start your terminal to use beginner mode.

Scenario:

You have a Git repository at /home/interview/repo where your feature-refactor branch has four commits in the wrong logical order. The commits should be reversed (oldest to newest becomes newest to oldest) to make more sense for code review. You need to rebase this branch onto the latest main branch while reversing the commit order.

Task:

Navigate to /home/interview/repo, rebase feature-refactor onto main while reversing all commits using interactive rebase, and verify the commits appear in the correct reversed sequence with all changes preserved.

Terminal requires a larger screen

Open this page on a desktop or tablet (≥ 768px) to launch the terminal and practice hands-on.

Linux Terminal Environment

Write and execute your solution in the terminal below.

Sign In

Track

Question Difficulty Company Access
Need more practice in this area? Explore more questions →