<mohammadrony>

Patch

Create

Current change

git add .
git diff > <file>

Specific commit

git format-patch -1 <commit>

Commit to HEAD change

git format-patch <commit>

Save patch in directory

git format-patch -1 <commit> -o <path>

Apply

Check

git apply --check <file>

Apply

git apply <file>
git apply --verbose <file>

Apply in reverse

git apply -R <file>