My nail bed turned black a few days after my trip. It never hurt. The nail never really even felt irritated during the hike. But thousands of seemingly sub-injurious contacts with your footwear will cause bruising and damage, resulting in eventual nail loss.
I could tell the nail was a goner and that it was in the process of separating from the nail bed, but it was still attached at the cuticle, so I wasn’t about to yank on it. I did put a piece of tape around my toe to hold the nail in place the first hike or two, but the tape just slipped off after a few miles and wasn’t helping, so after that I was just a bit careful (when pulling my sock on, etc) and didn’t worry about it too much. I kept the end trimmed so that it didn’t catch on stuff. Just recently most of it released from the cuticle and I trimmed back those portions that I could lift free, but I still have about 20% of the nail in place. Eventually that will fall off too.
You might be in a slightly different situation since it was a quick trauma that separated the nail. Like the difference between an intact blister (sterile) and a popped blister (bacteria can get in). But if you can get through the suture period and the nail bed forms new skin, after that I think you would be okay.
Many years ago I separated a big toenail in the way you just experienced (sudden and violent trauma). It was still attached at the cuticle. The ER doc just shoved the nail back in place and bandaged it up. There was some pain, and I had to wear open toe footwear for a while, but it didn’t take long for the nail bed to skin over and I just waited for the rest of the nail to fall off of its own accord. I was probably wearing tape on that toe for a few weeks and took it easy. As long as you can tolerate the tape and discomfort, you can probably get back to normal activity pretty quick. It’s not like a broken bone. As soon as skin forms on the nail bed, you are solid (in my experience).