Modify contents of an old commit in your branch
ID: git-tips/modify-contents-of-an-old-commit-in-your-branch
Git tips Modify contents of an old commit in your branch by
Ciro Santilli 36 Updated 2025-04-24 +Created 1970-01-01
Before:
7 my-feature HEAD
|
6
|
5 master
|
4
|
3
|
2
|
1
Oh, commit 6 was crap:
git rebase -i HEAD~2
Mark
6
to be modified.After:Better now, ready to push.
7 my-feature HEAD
|
6v2
|
5 master
|
4
|
3
|
2
|
1
New to topics? Read the docs here!