FIFO (First In First Out) method is followed for purpose of accounting and computing P&L. So when you sell shares, the shares that are not pledged will be debited from your holdings, and the shares that are pledged will have an average price of Rs. 140.
You don’t have to unpledge the shares or pledge them again in this scenario. Would suggest you check out this thread: Sell a pledged scrip - #4 by Nakul