Covalent organic frameworks (COFs) are a family of promising membrane materials because of their intrinsic pores with uniform size, tunable functionalities, and high stability. Especially, two-dimensional (2D) COFs can be exfoliated into single- or few-layered nanosheets and restacked into molecular sieving membranes through controlling restacking modes and thickness. However, the traditional methods mainly rely on increasing the thickness (vertical restacking control) to achieve high separation selectivity but with limited permeance. Herein, the fabrication of ultrathin COF membranes through a horizontal restacking control with the aid of introducing thermal perturbation is reported, i.e., a heating vacuum filtration method to optimize the relative displacement of nanosheets in horizontal direction without sacrificing thickness control. The obtained membrane exhibits high H2 permeance (655.6 GPU) and H2/CO2 selectivity (43.2) for CO2 pre-combustion capture. Furthermore, this method also displayed its universality to control the restacking microstructures of other COF nanosheets and the resulted properties of membranes.