Question: I want to check a header in my source file and if its already defined, I want to undefine it.

Is it possible?

Answer: 
`#undef` is the opposite of `#define` and actually cancels it.

It's very useful when you need a macro for some task but does not wish to "pollute" the symbol tables

```
// referencing FOO is an error (not yet defined)

#define FOO(arg_) ....

FOO(A)
FOO(B)
FOO(C)

#undef FOO

// referencing FOO now is an error (not defined)

```

There is no way to cancel a `#include` directive.
You can't do what you seem to want to do. If you don't want the header included your choices are 

don't include it in the first place

conditionally include it or not via the prepocessor e.g.

```
#ifdef INC_MY_HEADER
#include "myheader.h"
#endif

```

or assuming the header has header guards just define the header guard before the header is included e.g. from the commend line -DMY\_HEADER or similar

If the real problem is that you have different headers defining things with the same name then you probably need to look into [namespaces](http://www.cplusplus.com/doc/tutorial/namespaces/) so you don't get clashes