The difference is in the spelling. The tritone (augmented 4th
(A4)/ diminish 5th(d5)) is named in the context it is analysed in.
The notes of G7 in order are G, B, D, and F. G to B is a Major 3rd (M3), G to D is a Perfect 5th (P5), and G to F is a minor 7th (m7). We analyse the G as the root note everything is based on the distance from G to the other notes. We could look at B to G as a minor 6th(m6), or D to G as a Perfect 4th (P4), or F to G as a Major 2nd (M2). The reason we don't is it isn't useful to analyse this way because we stack chords in 3rds. We analyse from the bottom (root) up. Because of this the distance from B to D is a minor 3rd (m3) and the distance from B to F is a diminished 5th (d5). Again it can be inverted, but this is not useful for analysis.
In the context of scales, there are two modes that demonstrate how the a diminished 5th and an augmented 4th are different. The modes are Lydian and Locrian. Because the 4th degree of the Lydian scale is greater than perfect, the interval is an Augment 4th and because the 5th degree of the Locrian scale is less than perfect the interval is a diminished 5th. Below I put the two modes based on C major.
F G A B C D E F
P1 M2 M3 A4 P5 M6 M7 P8
B C D E F G A B
P1 m2 m3 P4 d5 m6 m7 P8
It is the same internal, but the context lets you know what to call it. If you need more clarification let me know this is a rather broad topic.
Here is a source on interval notation and their inversion.