You can first use the `show_transfers` command in `monero-wallet-cli` to see if your transaction shows there. It should show as "pending". Subsequently, you can use the `flush_txpool` command in `monerod` (the daemon). The wallet will shortly notice this and change the status of the transaction from "pending" to "failed". In order to get the right balance, however, you also need to run the `rescan_spent` command in `monero-wallet-cli`. Note that this minor bug (i.e. not showing the correct balance) is fixed in master currently, but not yet present in the binaries (which you are likely using). If this doesn't work, you will have to use the `rescan_bc` command in `monero-wallet-cli`. >Also, what steps can I take to prevent a transaction from getting stuck as pending in the future? Make sure your daemon is fully synced before sending out a transaction. **Source:** https://bitcointalk.org/index.php?topic=583449.msg16066918#msg16066918