In a nutshell: Elon Musk seems to have changed his mind again and will buy Twitter after all for the originally agreed-upon amount. He will end up paying $54.20 per share, with the entire deal being worth around $44 billion.

According to a new SEC filing, billionaire Elon Musk will go through with his Twitter acquisition, after all, provided the company drops its lawsuit against him. Twitter shares rose 22 percent when the news broke, while Tesla shares fell about 5 percent but have recovered somewhat since then.

So how did this whole ordeal start? In April, Musk disclosed that he purchased a 9.2 percent stake in Twitter. The company quickly offered him a seat on its board of directors, which Musk eventually rejected as it wouldn't bar him from ever acquiring a stake larger than 14.9 percent. The billionaire then announced his plans to buy the whole company in a deal worth $44 billion.

After the company accepted, Musk quickly gained cold feet, citing concerns about the number of spam and fake accounts on Twitter, among other issues. In July, he formally requested to get out of the deal, which prompted the company to sue him. That trial is scheduled to start on October 17 and might still go through if the two parties don't come to an agreement by then.

Musk likely changed his mind (again) due to his legal team reportedly believing that the case wouldn't go his way. Press reports indicate the assigned judge repeatedly sided with Twitter in pretrial rulings, with the recent emergence of a whistleblower apparently not improving expectations enough.

Twitter said it received the letter and planned to accept the deal at the price they initially agreed upon in April. Musk later tweeted that he intends to make Twitter an "everything app," which likely means expanding its feature set to more than just social media. This makes it sound a bit like WeChat, a popular social media app in China that's also used to order food, book rides, make payments, and more.

We'll have to see in the next few weeks if Twitter will go private, finally bringing this rollercoaster to an end.