Discrete numerical simulations are performed to study the evolution of the micro-structure and the response of a granular packing during successive loading-unloading cycles, consisting of quasi-static rotations in the gravity field between opposite inclination angles. We show that internal variables, e.g., stress and fabric of the pile, exhibit hysteresis during these cycles due to the exploration of different metastable configurations. Interestingly, the hysteretic behaviour of the pile strongly depends on the maximal inclination of the cycles, giving evidence of the irreversible modifications of the pile state occurring close to the unjamming transition. More specifically, we show that for cycles with maximal inclination larger than the repose angle, the weak contact network carries the memory of the unjamming transition. These results demonstrate the relevance of a two-phases description -strong and weak contact networks-for a granular system, as soon as it has approached the unjamming transition.