Can I undo bonus depreciation because I now plan to sell?
No, not after the return is due. The election not to take bonus is made for a whole class of property, such as all 5-year property placed in service that year, by the due date, including extensions, of the return for the year the property was placed in service. After that you generally cannot elect out, revoking an election needs the IRS's written consent through a private letter ruling, and neither can be done by changing your accounting method. If you have not filed that year's return, you can still elect out.
Learn more: One-pager: you did a cost seg, now you want to sell · Explainer: what happens when you sell
General information, not tax advice. Tax law changes, and the right answer for your return depends on your facts.