If you work as a freelancer or partner in a small agency that does software development for non-technical clients, then keeping ownership and reselling your work is often possible. You can negotiate to sell the client a non-exclusive license.
But it's not realistically possible for an individual contributor at a medium to large tech company. There are too many people involved with each project or product, and no part of it is individually useful. You can't resell a git patch that fixes a bug in an existing codebase.