First you need to move your changes to branches:
This is for example your original log
#git log --graph --decorate --oneline -n13
* e40f865 (HEAD, master) Change 2
* 120c061 Change 1
* 73a8f97 Initial commit
Now move them into a branch:
#git branch changeA 120c061
#git branch changeB e40f865
#git log --graph --decorate --oneline -n13
* e40f865 (HEAD, master, changeB) Change 2
* 120c061 (changeA) Change 1
* 73a8f97 Initial commit
As you can see, changeB depends on changeA. Now reset the master so the changes are not in the master but really in the branch:
#git reset --hard HEAD~2
HEAD is now at 73a8f97 Initial commit
Now, checkout changeA and make you change. The amended commit:
#git commit --amend -a
[changeA 93837a4] Change 1
2 files changed, 3 insertions(+), 2 deletions(-)
#git log --graph --decorate --oneline -n13
* 93837a4 (HEAD, changeA) Change 1
* 73a8f97 (master) Initial commit
As you see the change 1 has a new SHA1, next checkout changeB:
#git checkout changeB
Switched to branch 'changeB'
#git log --graph --decorate --oneline -n13
* e40f865 (HEAD, changeB) Change 2
* 120c061 Change 1
* 73a8f97 (master) Initial commit
Now you see that changeB still depends on the original change 1, you just need to rebase the change to the new change 1.
#git rebase 93837a4
First, rewinding head to replay your work on top of it...
Applying: Change 1
Using index info to reconstruct a base tree...
....
....
Applying: Change 2
#git log --graph --decorate --oneline -n13
* d3fac58 (HEAD, changeB) Change 2
* 93837a4 (changeA) Change 1
* 73a8f97 (master) Initial commit
And now you have the updated changeB that depends on the update changeB and you can submit it again to Gerrit for review