Hi Tineke,
If you have customised a theme without creating a child theme then yes your customized code will be lost. So only customize after creating a Child theme.
Thank you!