This is one of the exciting things about pots. They're probably among the most controllable of fishing gear, meaning that you can make escape panels, you can change the entry size, you can make the entry rigid, or you can make it soft. If it's rigid, you set a maximum size for the animals that can get in there.
Whether the fish can survive and be released again is species-dependent. With cod, there have been tagging studies done elsewhere in the world where survival has been pretty good, but it depends how deep you're fishing them from.