A little dab of glue should hold them in place. Wipe down the fretboard so you don't have extra bumps on the surface from dried glue. I've seen people use everything from wood glue to super glue. When I defretted my bass I just sized the fretline material a little bit large and smashed them in with a rubber mallet then sanded the fretboard with a radiused block.
That being said you may want to take what I say with a grain of salt. Lol!
I did it carefully and it worked just fine, so thanks!