I just read amending a single file in a past commit in git but unfortunately the accepted solution \'reorders\' the commits, which is not what I want. So here\'s my question
You can avoid the interactive stage by using a "null" editor:
$ EDITOR=true git rebase --autosquash -i ...
This will use /bin/true as the editor, instead of /usr/bin/vim. It always accepts whatever git suggests, without prompting.
/bin/true
/usr/bin/vim