Poor gambit for white I was white and played this against a 1589 rated player on Lichess.

The gambit happens at move 10 and it is characterized as a blunder by stockfish analysis. However, black does some inaccuracies and after a couple of moves he is trapped. Black does a blunder on move 13, and black cannot avoid being checkmated. It looks obvious from the analysis that black should have used the other pawn.

Are there any more experienced players that could tell me some of the possible moves that black can do to avoid getting into trouble and also what white can do instead of taking the risks that i took after move 10. I am wondering what white should do after realizing the gambit was a blunder.

[fen ""]
[Event "Hourly Blitz Arena"]
[Date "2019.02.23"]
[Round "-"]
[White ""]
[Black ""]
[Result "1-0"]
[Variant "Standard"]
[TimeControl "300+0"]
[ECO "B21"]
[Opening "Sicilian Defense: Smith-Morra Gambit"]
[Termination "Normal"]
[Annotator "lichess.org"]

1. e4 c5 2. d4 { B21 Sicilian Defense: Smith-Morra Gambit } cxd4 3. Qxd4 Nc6 4. Qd1 Nf6 5. Nc3 d6 6. Bb5 Bd7 7. Nf3 a6 8. Ba4?! { (-0.03 → -0.56) Inaccuracy. Best move was Be2. } (8. Be2 e6 9. O-O Be7 10. Bf4 Qc7 11. a3 O-O 12. h3 b5) 8... b5 9. Bb3 b4?! { (-0.34 → 0.50) Inaccuracy. Best move was e6. } (9... e6 10. Qd3) 10. Bxf7+?? { (0.50 → -2.95) Blunder. Best move was Nd5. } (10. Nd5 e6 11. Nxf6+ Qxf6 12. O-O Be7 13. a3 bxa3 14. Rxa3 Ne5 15. Nd4 d5 16. exd5 Bxa3) 10... Kxf7 11. Ng5+ Kg8 12. Nd5 h6? { (-3.82 → -1.07) Mistake. Best move was e6. } (12... e6) 13. Nxf6+ exf6?? { (-1.26 → Mate in 2) Checkmate is now unavoidable. Best move was gxf6. } (13... gxf6) 14. Qd5+ { Black resigns. } 1-0
I'm an FM so I guess I'm experienced. For Black's POV, the 12...e6 variation you gave is the best way to play. It pretty much stops White's attack and Black's just up a piece. If he really wanted to Black could have also gone for 11...Ke8 followed by ...e6. In any case, playing with ...e6 is the way to go since it covers up all Black's weak light squares.

For you, I'd recommend not going for 3.Qxd4 (it's rather dubious). If you want to go for this kind of setup, consider playing 2.Nf3 and after 2...d6, 3.d4 cxd4 4.Qxd4. Of course you couldn't go this after 2...Nc6 though. If you still want to play 3.Qxd4, consider 4.Qe3 followed by 5.c4. It gives you a bind in the centre at least.

After 9...b4 in the game, you should have played 10.Nd5. You're a bit worse, but at least the game is close to equal. After 10.Bxf7, I think you played well to get compensation. I wouldn't recommend playing safe AFTER 10.Bxf7, since you need to attack to make up for being down a piece.