I'm sorry you lost your villager but don't worry, it's just a game anyway and you can get Rosie back through cycling and getting her back from someone else.
In the future, you can prevent losing villagers when you're away by doing one of two things.
If you know you will be away in advance, turn down a villager's request to move on the last day you play (if nobody pings you, just move ahead day by day and get someone to ping you about it). This means you can leave your game alone for as long as you want and when you go back, nobody will have moved because the last day you played, you turned down a request to move.
If it's an unexpected absence from your game, don't panic. Do NOT start the game as your mayor. Instead, start the game as a new character (a side character who will be in the same town, don't delete your mayor or anything). The answers you give in the train sequence don't matter since you won't have to keep this character anyway. When you get to the station, Porter will give you a town map and tell you to go to the town hall. Do NOT go to the town hall. Instead, check the map carefully to see if any villager houses are missing. If none are missing and you want to be extra careful, go visit all villagers who are in their homes (you don't have to go into the town hall to do this so don't go there) and see if anyone is in boxes.
If someone moved away or were in boxes, quit without saving. Go to the 3DS settings and set the date to the day you last played. This will trick the game into thinking no time has gone passed at all. If you can't remember the date you last played, you can check your 3DS activity log.
Now go back to your game and load as your mayor, you should be on the date you last played now. Go find the villager who was missing in the present, and see if they ping you. If they don't ping you, talk to them 5-6 times and see if they mention moving. If they don't, save and quit, load the game as your mayor again, and try seeing if they ping you, talk to them, etc. They'll ask you to move after a few tries. If they don't, go back to the 3DS clock and set it to the next day, then try that process of seeing if anyone asks you to move again. Go on day by day until you get a request to move. Say no, then save and quit. Go to the 3DS calendar again and set it to today's date. You'll now be able to safely load as your mayor in the present and nobody will be gone.