I keep a roster of all of my cars and locos, and for my free-lanced roadnames, the list includes
all cars, including those that have been sold or given to others. Since the roster is constantly changing, this prevents duplicate numbers from appearing, either on my own layout or on those of others, who seem to snap up any stuff that I sell.
I often have freight cars in boxes which are not the originals - most used rolling stock doesn't come with a box, and I find it useful, especially for similar cars such as hoppers lettered for my "home" roads, to put multiple cars in the same box. I can fit 4 two bay hoppers in a long Athearn box, or two flatcars or gondolas in the wide Walthers boxes. This frees-up empty boxes for those used and scratchbuilt cars.
I keep all of the freight cars that aren't on the layout on shelves beneath my staging yards, in boxes with the ends showing, much as you'd see in a hobby shop:
With simple hand-lettered labels made from masking tape, and the cars grouped as to type and roadname, it's easy to find the cars for which you're looking.
Locomotives, passenger cars, and MoW equipment is stored in homemade trays inside fruit and vegetable boxes, making them easy to find and also easy to transport:
Of course, I'm in the process of getting rid of all my cars and locos that are too modern for a 1930s-era layout, so the roster will need to be updated - some current cars will simply be re-lettered with the same roadname and number, in an older-style paint scheme, while others will be replaced with more suitable cars, painted and lettered to more correctly represent the era.
Wayne