You need use you git remote url and specify branch after hash(#).
yarn add https://github.com/opentripplanner/otp-react-redux.git#result-post-processor
installs a package from a remote git repository at specific git branch, git commit or git tag.
yarn add <git remote url>#<branch/commit/tag>