To modify a specific commit in Git, you can use the git rebase with the appropriate commit id. The syntax to modify a specific commit is given below:
git rebase --interactive <commit>
Example : If you want to modify a commit “e2abc532” then,
git rebase --interactive 'e2abc532^'
Also Read:
How to modify unpushed commit message