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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I updated the answer accordingly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.