Virat Kohli scored his first century in over three months after touching the three-figure mark against Pakistan in Dubai.