To reset the counter to zero:
echo "0" > counter.txt
To set a specific starting value:
echo "1000" > counter.txt