Generalized inverse designed to reconstruct a specific vector Assuming we have some matrix $P\in\mathbb{R}^{m\times n}$, with $m<n$, that maps vectors $\mathbf{x}\in\mathbb{R}^n$ to $\tilde{\mathbf{x}}\in\mathbb{R}^m$ as $\tilde{\mathbf{x}} = P \mathbf{x}$, how would one construct a generalized right inverse $\bar{P}$ of $P$  that exactly reconstructs one specific vector $\mathbf{x}^\ast$ such that $\bar{P}P\mathbf{x}^\ast=\mathbf{x}^\ast$?
I realize that for given $P$ and $\mathbf{x}^\ast$ this problem can be addressed by simply simultaneously solving all equations defined by $P\bar{P}=I$ and $\bar{P}P\mathbf{x}^\ast=\mathbf{x}^\ast$, but my question is whether there is a general equation by which suitable generalized inverse can be constructed in terms of an unknown $P$ and $\mathbf{x}^\ast$.
Edit: the Moore-Penrose (M-P) inverse is not what I'm looking for. Consider the simple case 
$$P = \left(\begin{array}{ccc}1 & 1 & 0 \\ 0 & 0 & 1 \end{array} \right),\; \mathbf{x}^\ast=\left(\begin{array}{cc}1 & 2 & 3\end{array} \right)^T.$$
This yields the M-P inverse
$$P^+ = \left(\begin{array}{cc}0.5 & 0 \\ 0.5 & 0 \\ 0 & 1 \end{array} \right)$$
such that $P^+P\mathbf{x}^\ast = \left(\begin{array}{cc}\frac{3}{2} & \frac{3}{2} & 3\end{array} \right)^T \neq \mathbf{x}^\ast$. 
Instead, I would here seek the generalized inverse
$$\bar{P} = \left(\begin{array}{cc}\frac{1}{3} & 0 \\ \frac{2}{3} & 0 \\ 0 & 1 \end{array} \right),$$
which gives the desired property $\bar{P}P\mathbf{x}^\ast =\mathbf{x}^\ast$. Beyond this example I am seeking a general formula for the construction of such a generalized inverse. In cases like this example, where the rows of $P$ are pairwise orthogonal, I believe such a matrix can always be constructed as
$$\bar{P}=XP^T\left(PXP^T\right)^{-1}$$
with $X:=\text{diag}(\mathbf{x}^\ast)$. However, I require a general formula for all matrices $P$.
 A: Since $P$ is supposed to have a right inverse, it must necessarily have rank $m$.
Let $P^+=P^T(PP^T)^{-1}$ be the Moore-Penrose inverse of $P$.
Any right inverse of $P$ has the form
$$\tag{1}
\bar P=P^++Q,
$$
where $Q\in\mathbb{R}^{n\times m}$ is such that $PQ=0$, that is, the columns of $Q$ are in the nullspace of $P$. Since $PP^+=I$, it is easy to verify that
$$
P\bar P=PP^++PQ=I+0=I.
$$
Let $x\in\mathbb{R}^n$ be a nonzero vector such that $Px\neq 0$ (otherwise, any right inverse is a candidate for a solution). Since $\mathrm{R}^n=\mathrm{Im}(P^+)\oplus\mathrm{Ker}(P)$ and $P^+P$ is an orthogonal projector onto $\mathrm{Im}(P^+)=\mathrm{Im}(P^T)$, we can express $x$ (uniquely) as
$$
x=y+z, \quad y=P^+Px\in\mathrm{Im}(P^T), \quad z=x-y\in\mathrm{Ker}(P).
$$
We want $x=\bar PPx$, that is, $x=(P^++Q)Px=y+QPx$, which is equivalent to (with $u:=Px$)
$$
Qu=z.
$$
Hence choosing any $Q$ such that $PQ=0$ and $Qu=z$ will give a right inverse of $P$ such that (1) holds.
For a nonzero vector $v$, let $v^+=v^T/(v^Tv)$ be the MP inverse of $v$. A particular matrix $Q$ can be chosen as (note that $u\neq 0$ by assumption)
$$\tag{2}
Q=zu^+,
$$
so for this $Q$, $\bar P$ has the form $\bar P=P^++zu^+$, that is, a rank-one modification of the MP inverse of $P$. It is easy to verify that $Qu=z(u^+u)=z$.
Any other $n\times m$ matrix $Y$ such that $PY=0$ and $Yu=0$ can be added to (2) without violating the conditions $P(Q+Y)=0$ and $(Q+Y)u=z$. Such matrices can be parameterized as
$$
Y=(I-P^+P)Z(I-uu^+), \quad Z\in\mathbb{R}^{n\times m}.
$$
We can summarize:

Let $P\in\mathbb{R}^{m\times n}$, $\mathrm{rank}(P)=m$, $x\in\mathbb{R}^n$ such that $u:=Px\neq 0$. Any right inverse $\bar P$ of $P$ such that $\bar PPx=x$ has the form
  $$\tag{2}
\bar P=P^++(I-P^+P)[xu^++Z(I-uu^+)],
$$
  where $Z\in\mathbb{R}^{n\times m}$. 

For example, for 
$$
P=\pmatrix{1&1&0\\0&0&1}, \quad x=[1,2,3]^T,
$$
setting $Z=0$ in (2) gives
$$
\bar P=
\frac{1}{2}\left(\begin{array}{cc} 1 & 0\\ 1 & 0\\ 0 & 2 \end{array}\right)
+
\frac{1}{12}\left(\begin{array}{ccc} 1 & -1 & 0\\ -1 & 1 & 0\\ 0 & 0 & 0 \end{array}\right)
\pmatrix{1\\2\\3}
\pmatrix{1\\1}^T
=
\frac{1}{12}\left(\begin{array}{rr}5&-1\\7&1\\0&12\end{array}\right).
$$
A: I believe what you are looking for is the Moore-Penrose inverse. If your matrix has full rank, then $PP^T$ is an invertible $m \times m$ matrix, and the Moore-Penrose inverse is $\bar P = P^T(PP^T)^{-1}$. The matrix $\bar P$ is an $n \times m$ matrix such that $$\bar P|_{\operatorname{range}(P)}: \operatorname{range}(P) \to \ker(P)^\perp$$ is an isomorphism. 
