Is there a way to modify an older commit(the files in that commit) without create a new commit?
If the commit and at least on later one is already pushed to the server:
The short answer is "no".
The long answer is that it is possible to do this with Git (not SourceTree), but it is rather complicated and all the other users of the repository would find themselves with an incompatible version of the history that they would need to repair afterwards.
The best way to do this is to revert the commit you want to modify and create a new one with the right changes.
If the code is not pushed yet, which seems to be the case:
The commit is not pushed. Can it change the answer?
Yes, I updated the answer accordingly.
It looks like you're new here. Sign in or register to get started.