I've had an intern uploading code to his G Drive and after talking to him I concluded he was not malicious, just dumb.
That said you can't claim innocence for not knowing some law, plus any half serious company makes you sign cyber security / IP stuff during the hiring process (ofc one is entitled to sign contracts without reading them).