How can I stop player snapping back to 0,0,0 rotation when I release keys?

My player moves with my keys properly, but when I release the keys he snaps back to pointing directly upwards. How can I stop this?

(Script placed on cube with Character Controller):

using UnityEngine;
using System.Collections.Generic;
using System.Collections;

public class PlayerControl : MonoBehaviour
{

    public float speed = 9.0F;
    public float gravity = 13.0F;

    private Vector3 moveDirection = Vector3.zero;
    public CharacterController controller;

    void Start()
    {
        // Store reference to attached component
        controller = GetComponent<CharacterController>();
    }

    void Update()
    {

        // Character is on ground (built-in functionality of Character Controller)
        if (controller.isGrounded)
        {

            moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
            moveDirection = transform.TransformDirection(moveDirection);
            transform.GetChild(0).rotation = Quaternion.LookRotation(moveDirection);

            moveDirection *= speed;

        }

       //GRAVITYYY
        moveDirection.y -= gravity * Time.deltaTime;
        controller.Move(moveDirection * Time.deltaTime);

    }
}

Your rotation is resetting because you always assign it a value based on user input. What you need to do is have the character rotate only when moving. Line transform.GetChild(0).rotation = Quaternion.LookRotation(moveDirection); needs to be in some sort of if statement, depending on how you want this to behave.

Try the following and you will get the idea:

if ((moveDirection.x != 0) || (moveDirection.z != 0))
{
	transform.GetChild(0).rotation = Quaternion.LookRotation(moveDirection);
}