If the particular stock is already present in your demat account, then the quantity that you shorted would be sold from your demat holding in this case. The reasoning behind why this happens is explained in a different thread -
You must know that product codes like ‘MIS’, ‘CNC’ are native to a trading platform. They have no relevance to the actual trades that take place on the Exchange. These are merely product codes created by brokers to allow their client to take positions under for getting margin/other benefits (MIS has benefit of being charged lower margins).
Technically an intraday trade is a trade where both legs (buy & sell) of the transactions take place on the same day. The transaction could happen in product code ‘CNC’, ‘MIS’, ‘NRML’ anything. For example, if you buy 100 shares of Reliance on CNC and sell 100 shares of Reliance on the same day under product type ‘CNC’, it’s still an intraday trade despite the product code used being ‘CNC’.
So the way for you to identify if a trade is intraday is to verify the number of shares/contracts bought and sold during the same day. All such trades will be intraday and the remaining will be delivery/overnight trades.