Yep, FDR will do it for you.
That said, if you intend to sell it or give it to a friend or family member, you'll want to return it to stock first. There's nothing worse than getting a used phone from someone who has rooted it and not knowing exactly what method they used, what rom or kernel may have been flashed to it, etc. Return it to stock first, then do a FDR. Even if you intend to keep it, it's best to return it to stock anyways because more than likely after you've had your new device for a year or two, you aren't going to remember what was flashed on your old device and you may have difficulties finding developer support and valid root files by then.
Good luck & let us know what you end up getting to replace it. [emoji106]
S5 tap'n