Open the .gitignore file in your repository's root folder with a text editor like notepad.
Replace this line
/[Uu]ser[Ss]ettings/
With this one
# Ignore everything inside the UserSettings folder (case-insensitive)
/[Uu]ser[Ss]ettings/*
# Allow the folder itself to be checked (so Git can see inside)
/!UserSettings/
# Then unignore the specific file (be case-specific here!)
!UserSettings/UserStats_project.asset
The full gitIgnore file should look something like this
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore
#
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
# Ignore everything inside the UserSettings folder (case-insensitive)
/[Uu]ser[Ss]ettings/*
# Allow the folder itself to be checked (so Git can see inside)
/!UserSettings/
# Then unignore the specific file (be case-specific here!)
!UserSettings/UserStats_project.asset
# MemoryCaptures can get excessive in size.
# They also could contain extremely sensitive data
/[Mm]emoryCaptures/
# Recordings can get excessive in size
/[Rr]ecordings/
# Uncomment this line if you wish to ignore the asset store tools plugin
# /[Aa]ssets/AssetStoreTools*
# Autogenerated Jetbrains Rider plugin
/[Aa]ssets/Plugins/Editor/JetBrains*
# Visual Studio cache directory
.vs/
# Gradle cache directory
.gradle/
# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
*.mdb
*.opendb
*.VC.db
# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta
# Unity3D generated file on crash reports
sysinfo.txt
# Builds
*.apk
*.aab
*.unitypackage
*.app
# Crashlytics generated file
crashlytics-build.properties
# Packed Addressables
/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*
# Temporary auto-generated Android Assets
/[Aa]ssets/[Ss]treamingAssets/aa.meta
/[Aa]ssets/[Ss]treamingAssets/aa/*
Please note that if you aren't sure how .gitignore files work, it is better to look into it first before trying to change them.