Dont panic, its allright for this cable to come detached, ive done it a thousand times.
All you have got to do is pull the whie clip up all the way and then just push the ribbon cable back in the slot and then push the clip back down. its a bit fiddly but not hard. you dont need any specail tools or anything