I had changed a lot of files and added them in the Git staging area. Then, before committing them, I realised that I had to change the commit message of the previous commit. So, I did a git commit --amend
and changed the commit message without going through the change log. Well, that added the files in the staging area to the previous commit too.
What should I do so as to make the previous commit in its original form and get my changed files back in the staging area so I could commit them separately ?
For what it's worth, I realise that I should have committed my changes first and then changed the commit message history using git rebase -i
.