Git · Middle · Question 69 of 75

How can you edit an older commit's content (not just its message) before pushing?

Explanation

Rebase stops at that commit; change files, git commit --amend, and git rebase --continue replays the rest on top. Alternatively, make a --fixup commit and autosquash.

Further reading

Problem with a question

Git · Middle · question 69

Test yourself

Take the Git · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz