Just think of it as an opportunity to find some new music and be careful with the delete button next time.
No point steaming over an accidental delete, most people have done it.
But see it's not necessarily the Apple Music tracks alone that can end up affected. Your iCloud Music Library may contain tracks from an iTunes base library that may have been pointed at (via a prior sync of your mobile device's music through the laptop/desktop iTunes app) when you established the Apple Music subscription. If you agree to merge that library and your AM music --which is what happens if you turn on iCloud Music Library, and which must happen if you wish to download AM tracks instead of just streaming them-- then the tracks in that library get examined and if Apple doesn't have them on hand already as AAC files, they get uploaded and then redownloaded as AAC files. This is so that your iOS device can contain the equivalent of a mix of your own stuff and Apple Music stuff you have elected to download.
With iOS Apple Music, it's do it their way re library merges, or don't plan on downloading any AM tracks. There's an option to stream from AM without downloading. That's what I have to use because I sync all my mobile gear's music to iTunes libraries on laptops.
I do have one laptop library that I use just for Apple Music and download tracks to, so for that iTunes library only, I have iCloud Music Library turned on. So really I mostly use (and yes, download) Apple Music on one laptop. Everywhere else I don't turn on iCloud Music Library and so cannot download AM, only stream it.
The iOS on a mobile device gives you the option to say "Not Now" when you turn on Apple Music feature and it asks if you want to "merge your library into iCloud Music Library." So I take that "Not now" route with my iPhone and iPod touch gear. The iCloud Music Library stays shut off on all my mobile gear. Not least because I want my mobiles to retain their independent views of my music. None of this "when you delete this track, it will be deleted across all your devices." What? No thanks. Different iOS devices that I own all have intentionally very different collections of music on them. I'm not going to have the same music on a 32GB iPod touch that I have on a 256GB XR.
I do have one small iCloud Music Library that was created for use only with one particular Apple music oriented setup on my laptop; sometimes I might option-drag data files into its media folder from other iTunes libraries of mine and then using iTunes menu File option "Add to library..." at which point they then also end up added to iCloud Music Library, but they're added from the viewpoint of that target library, not the original library from which I dragged copies of the data files. Then really I don't care that those few copies or the AAC equivalents if Apple doesn't have them in the cloud already might take a hike if and when I make a mistake and delete more than I meant to, or even ditch the AM subscription altogether, since they're just copies of data files that reside in an iTunes library not referenced at all by my laptop use of Apple Music.
I must remain very careful never to turn on iCloud Music Library for an iOS device that I sync to some other of my iTunes libraries though, because that would actually trigger the process of adding what could be tens of thousands of tracks from that library to my now (and intentionally tiny) iCloud Music Library. So "Not now" is my watchword when I'm using an iPhone and turn on Apple Music feature and then get that question asked about do i want my library MERGED... uh no... no way!
So bottom line, when using your Apple Music, you happen to delete more than you meant to delete, it might not be just your AM stuff, could also be stuff that you own. If you don't already have some physically separate backups of the latter tracks, then you do have a problem that can't be resolved if the deleted material was not purchased from Apple, i.e. if you originally ripped it from your CDs etc and don't have a backup of those files stashed away somewhere.