How to recover data from a corrupted /base/ directory? I have deleted all directory by mistake except from the given link
/var/lib/postgresql/9.5/main/base/18686 and so on.

I have 4 such directories, now I want to get data back from those folder as they are very important.

I am using ubuntu 16.04.

Can you please help us?
It seems like you have deleted folders like 

pg_xlog
pg_tblspc
pg_serial


With only base directory :   /var/lib/postgresql/9.5/main/base/18686
You can't recover data.
You can refer to the documentation.

If you have a dump file recovering from it might be the only solution.