WASHINGTON—President Trump and House Republicans upended a bipartisan effort to fund the government until February on a day of sudden reversals that left lawmakers Thursday with no clear path to avoid a partial government shutdown this weekend.

Two days after Mr. Trump had signaled he was backing off his demand that Congress include $5 billion to fund a southern border wall in any year-end spending bill, the president changed course and told House GOP leaders hastily summoned to the White House that he would veto the short-term...