📝 Edit page
➕ Add page
Edit an earlier commit
If you want to edit a commit in the history without doing a reset and having to redo the commits after. The approach here is to do an interactive rebase.
- Start interactive rebase
git rebase -i HEAD~3 - Select commit to edit. In the text editor, change
picktoeditfor the target commit, then save and close. - Apply changes. Modify your files as needed and stage them.
git add <file-name> - Amend the commit
git commit --amend --no-edit - Complete rebase
git rebase --continue