How do I restore an account that was not deleted?
Log-in as admin user and open Terminal. Then enter

sudo dscl . read /Users/lost_username


Replace lost_username by the short name of the "hidden" or "lost" user.

If the user is still there check if the account is hidden:

sudo dscl . read /Users/lost_username IsHidden


If you get the following response: No such key: IsHidden you have a real problem. If it yields: dsAttrTypeNative:IsHidden: 1 your user is just hidden.

Unhide your user with:

sudo dscl . create /Users/lost_username IsHidden 0


or delete the key with

sudo dscl . delete /Users/lost_username IsHidden


You have to reboot after entering either of the last two commands to unhide the account.



If you get  DS Error: -14136 (eDSRecordNotFound) after entering the first command your user was deleted in the directory nodes.

Quick and dirty fix:

List the users' UniqueIDs with:

dscl . -list /Users UniqueID


Usually the first account created after installing OS X gets the 501, the second 502 and so on. Check for gaps (e.g. 502 is missing).

Rename (shorten) the abandoned user folder. Create a new user with the old user name (lost_username) and the old password. Check the UniqueID of the new user:

sudo dscl . -read /Users/lost_username UniqueID


Compare this UniqueID with the missing one. If they aren't the same, change the UniqueID of the newly created user to the missing one:

sudo dscl . -create /Users/lost_username UniqueID 502 #choose the missing ID here


Remove the newly created user folder (with the name lost_username). Rename the previously renamed (old and full with data) user folder to lost_username.

Log-in as lost_username.