Obama’s futile effort to get out of Afghanistan is probably the best comparison for Trump’s impulse to get out of Syria and resistance by military and most of foreign policy community.
Maybe the best comparison, but it's not close. US destabilized Afghanistan. Syria was unstable. US footprint in Afghanistan larger, and Afghan gov depend on US for security. Russia, Turkey, Israel, Iran all involved in Syria. Risk of interstate war. No equivalent in Afghanistan.