Praise be to Allah the Lord of the Worlds. May His peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
If this sale transaction was concluded without the objective of obtaining cash, then it is permissible because a person isn`t prevented from repossessing the commodity that he had sold. But, if the sale was intended for obtaining the cash, then this is dubious, however, we don`t command you (Asker) to terminate this sale contract if it had already been concluded. Nonetheless, we recommend that you make repentance and never redo what you did. And Allah The Almighty Knows Best.
* Einah sale (buy-back sale) refers to the purchase of something for the mere purpose of reselling it immediately to its original seller. The objective of this sale is to obtain cash in an apparently legal way and not the real acquisition of commodity.