It amazes me that people call the ending stupid or a fakeout or whatever other crap they're spouting. We KNEW this was how the movie was going to end, because it's the goddamn Infinity Saga. This is exactly how the comics did the same story decades ago; Thanos assembles the gauntlet, snaps his fingers, and wipes out half the universe, including a shit ton of heroes. There was really no other way they could have, or would have, gone with this. The fans wanted to see the Infinity Saga on the bigscreen, and they got it. If they'd have subverted it and gone a different route, after 10 years of build up, it would have been a massive let down.
Yes, we know it can be undone by the end, because that's the nature of the story and the powers used to wipe them out. Whoever has the gauntlet has omnipotence, so of cause there's a get-out clause, but that doesn't matter. People still died, those who didn't still had to watch them die, everyone still had to struggle and fight for survival. That shit has ramifications in itself. And not everyone is confirmed to be coming back. Those killed by the snap likely will, but anyone killed beforehand don't necessarily get a retcon, so seeing how/if they do bring those others back is interesting as well. And then theres still more that could die post-snap who might not come back, so there's still plenty of stakes, even if you don't buy the ones from the snap.
Personally, for someone who wanted to see the Infinity Saga, in all its glory brought to life, I think it was done extremely well and am satisfied we got to see it the way we did. I don't care if stuff can be reset, we know it's probably going to anyway, accept it and move on. Just because you know how a story is going to end, doesn't make it any less fun to watch.