I changed internal storage of Moto G 3 to sd card and recently i ejected the sd card and performed factory reset. When i inserted the sd card in the phone after factory reset it asked for formatting. Is my old data (photos/vids) still safe in sd card? How can i retrieve photos and vids from the sd card which had been formatted as an internal memory?
You can't access that data now. Once you reset the device you made it impossible for it to read that card. When you made it internal it encoded the card to that device, as the device was at that time. The card lost its connection to the device when you did the reset and there is really no way I know of to get it back.
So while the data is still on the card, it is encoded in a way that you can't unencode. Making the data pretty much impossible to get to. The only way around this is to take the data off the card prior to the reset, and turn the card external. Then when all done you put the card back in and make it internal again.
All files can be put on a card without making it internal, only apps need it to be that. So the only way around this issue, in the future, is to not make the card internal or use the steps I mentioned above.