I hit "Quit" and then it asked me if I wanted to save, so I pressed "save", when really I should have hit "cancel" and then "save as". Can I recover the old song?
If you haven't closed GarageBand then try
If it's closed and you've overwritten file there is little chance that you can recover your song because you saved that file in the same allocation. It's easier to recovery deleted files until they are overwritten by something else. You can try recovery files software like PhotoRec but as I said you have really low chances to succesfully recover it.
This data is gone unless you have any means of backup that has some form of version history, for example Dropbox, google drive, etc. Another option would be Shadow Copy, but by default, this is disabled. And how it works depends on your OS. For example it is File History in Windows 8, and has to be accessed through the Control Panel. It works differently in windows 10.
Shadow Copies work the same in Windows Server though, but I doubt that's the OS you're using.