The foundation may control the github repository of bitcoind/bitcoin-qt, however they do not control Bitcoin. If they have decided to give themselves 1 million coins or whatever, no one will use and people will fork in true open source fashion.
This is naive. Of course they would not do the obvious. But for a group of knowledgable persons it is easy to implement some "errors" that go unnoticed long enough to inflict serious damage.
Only a tiny fraction of all bitcoin users is able to understand the source code. And of this tiny fraction only few do actually verify it.
git is a revision control system.
Who made what changes that were devious would be recorded and changes to the code are scrutinized.
Maybe with an un-popular alt-coin it could happen, but I highly doubt in a project as globally popular as bitcoin that it would go un-noticed.