can you explain me the working of this circuit in detail?
You really should use component designators in your schematics.  Lack of them makes it more difficult to talk about the circuit, so I'll be more brief.

Consider what happens when the reed switch is open.  The first transistor is on, lighting the first LED.  The collector being low also turns off the second transistor, which keeps the second LED off.

When the reed switch is closed, the first transistor is forced off, so the first LED will be off too.  The second transistor is then turned on, which lights the second LED.

In summary, one LED is always lit.  The reed switch state governs which one.