Drag an object in unity3d

I want to drag an object to a perticular place.In case I release that dragged object before I reach that particular area ,the object should come to its initial place where i start to drag. How it possible? Is there any specific motion for this?

 void OnMouseDown()
 {

 drag = true;
//Debug.Log("haii ");
}
void OnMouseDrag()
{
if(drag)
{
    var pos =Input.mousePosition;
    pos.x =Mathf.Clamp(pos.x,0,Screen.width);
    pos.y =Mathf.Clamp(pos.y,0,Screen.height);
    if(zdist>0)
    {
    zdist=Vector3.Distance(Camera.main.transform.position,transform.position);
        pos.z=zdist;
        pos = Camera.main.ScreenToWorldPoint(pos);
        transform.position =pos;

    }
}
}

You can use the OnMouseDown() to store the initial position of the object.Then if the mouse is released within the target position,just release the object or if released in anywhere else position the object to initial position or lerp from released position to initial position

//vector to initial position
Vector3 Init_Pos;

void OnMouseDown()
{
  //Get the position of the object before the drag
  Init_Pos=transform.position;
  //State the drag is initiated
  drag=true;
}

void OnMouseDrag()
{
  if(drag)
  {
    Vector2 pos=Input.mousePosition;
    pos.x =Mathf.Clamp(pos.x,0,Screen.width);
    pos.y =Mathf.Clamp(pos.y,0,Screen.height);
    
    if(zdist>0)
    {
      zdist=Vector3.Distance(Camera.main.transform.position,transform.position);
      pos.z=zdist;
      pos = Camera.main.ScreenToWorldPoint(pos);
      transform.position =pos;
    }
  }
}

void OnMouseUp()
{
  if(/* Condition to check whether object reached target position */)
  {
    transform.position=targetposition
  }
  else //If object didn't reach target position place it back to initial position
  {
    transform.position=Init_Pos;
  }
}

You can use lerp instead of “transform.position=Init_Pos” using a coroutine.