A sally is a military action, a sudden charge in the direction of the enemy. A sally sometimes has the advantage of taking the opposing army by surprise.
When soldiers who have been on the defensive, having retreated to a foxhole or fort, make an abrupt offensive attack on their opponents, it's a sally. Another word for this kind of sally is a sortie. You can also call a sudden funny remark or comeback a sally, especially during a witty, back-and-forth, or bantering kind of conversation. The word comes from the Middle French saillie, "a rushing forth," from the Latin salire, "to leap."