Ubuntu with Git Repository- Change git commit message remotely via Ubuntu command Line


How to Change Commit Old to New Commit

In detail: Create a temporary work branch

Reset to the commit to replace

Amend the commit with the right message

Replace the old commit with the new one

[ Example : aba62f5 , 5ae6fb5]

go back to the branch where you were

[ Example : master, temp]

remove temp branch

How to switch back to ‘master’ branch with git

he problem with the other two answers is that the new master doesn’t have the old master as an ancestor, so when you push it, everyone else will get messed up. This is what you want to do:

Create New Branch –


To Merge Branch with Master from your system –

To Remove Unused Branch from your system –