Add custom identifiers to the geometry

Is there a way to add custom attributes (Identifier, relationship information) to the objects, so after transform/data structure changing I can still get back to their original data tree relationship?

So, let’s say I have bunch of lines, they are grouped in some kind of data tree structure.
Now I like to deconstruct- construct the data tree structure, randomly move/rotate them, maybe stretch them a little bit, but after all these changes I can still go back to the original tree structure, because I got their identifier and original relationship info stored somewhere.

You can unflatten with a guide tree.