This question already has an answer here:
Is it ethical to make a copy of my work's source code, for the sole purpose of my own reference? By reference, I mean as reference where I can refer to it about how I (and my teammates) implemented various design patterns, architecture, etc. It does not contain any trade secret, product, secret algorithm or anything like that.
Note that I wrote many parts of the source code, and also the added value from me studying the code will also indirectly benefit the company I am working on.