% This file is embedded in glossaries-extra-manual.pdf 
% Example 91 Combining prereset and preunset
% Label: "ex:preresetpreunset"
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage{glossaries-extra}
\glsdefpostlink{general}{\glsxtrpostlinkAddDescOnFirstUse}
 \newglossaryentry{sample}{name={sample},
 first={sample first use},
 description={an example}} 
\begin{document}
\gls{sample}. Used?
\ifglsused{sample}{Yes}{No}. 

{\glsfirst[preunset=local,prereset=global]{sample}.
Used? \ifglsused{sample}{Yes}{No}. } 

Used? \ifglsused{sample}{Yes}{No}. 

{\gls[preunset=local,prereset=global]{sample}.
Used? \ifglsused{sample}{Yes}{No}. } 

Used? \ifglsused{sample}{Yes}{No}. 
\end{document}