I have deleted a user account using the command userdel -r george
.
It deleted that user with their files.
I need to restore that user and their files, is it possible? How can I achieve it?
1 Answer
Not easily, no. The files have been deleted, you will need to use a tool that can recover deleted files, there is no undo for this. For help on recovering deleted files, see this Q&A:
Recreating the user is the easy part:
adduser george
For future reference, user management should be done with adduser
and deluser
instead of useradd
and userdel
.