How to restore rotation after parenting?

This is what I mean:
Rotation before parenting / attaching to Bone:
image

Rotation after parenting / attaching to Bone:
image

I had found this post which almost rephrase what I’m trying to do Rotate child mesh to match world direction vector unless I misunderstood it.
" Have rotation of a child mesh / node looks exactly the same regardless of parenting"

So my thoughts were:

  • Obtain rotation of the “sword” relative to the future parent
  • parent
  • Add relative rotation to the parent’s rotation so the new sword rotation “looks” the same as before

I’m sorry for my poor formatting and explanations

PS: Happy cake day!