It's actually not too difficult once you get within melee range. All you have to do is keep circle-strafing around the sentry and it can't get a lock on you.
Sentries turn notoriously slow at close range.
Old pyro trick for when they build sentries right around corners.
i stabbed a couple of lvl ones down today and thought it was pretty neat, but that feat pales in comparison with all the talk of taking out lvl 3 sentries with melee weapons. does a sapper count as melee?