Take the unused, not confirmed train ticket to the departure station.
Present the ticket at the ticket window and tell the clerk you would like to cancel the ticket and get a refund. You need to present the ticket before or within three hours after the actual departure of the train. If the ticket was issued for an entire day, you must present the ticket within three hours of the actual departure of the last train for the day.
Receive your refund and receipt for cancellation from the clerk. Indian Railways will deduct a service fee of 10 rupees when refunding the ticket.