Consider a very simple example: two files:


then content of each file is just 'first line'.

git init
git commit -m 'initial commit'

Then I add a second line to the first file.
I fake a mistake writing '2 line' inside the file.

git add one.txt
git commit -m 'added second line file one.txt'

The I add the second line to file two.txt "correctly"
'second line'.

git add two.txt
git commit -m 'added second line file two.txt'

Now I notice the mistake I made in the previous commit.
I wisht to fix '2 line' with 'second line'.
I can't use 'git commit --amend' because it will affect the last commit.

Ho do I manage to correct the commit 'added second line file one.txt'
without issuing another commit?

Considering that:
- these commits has not yet been "merged" by other users
- the amend scope is to fix a trivial error

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
For more options, visit

Reply via email to