To resolve this, open a Bash prompt in the root folder of the repository. ( A shortcut for this in SourceTree is to click on the 'Actions/Open in Terminal' menu. Run the following:
git rm --cached FolderName/MyFileName.extThen commit the change and push it up, and it should ignore the file from then on (assuming your .gitignore was correct to begin with). Note that this will leave the file as is in your source folder.