Selective buying helped Nifty recover losses, even as global market weakness and foreign fund outflows kept investor sentiment cautious