This solution is when you are using a ssh connection and you got disconnected with the "Broken Pipe" error.
Open with vim
~/.ssh/config and edit the file to add
ServerAliveInterval will send a request every 120, this will be helpful since some servers drop connections after some inactivity.
TCPKeepAlive value to no will help in situations when there are connections problems while ssh is idle in the background ti won't kill the connection.
Please leave comments if this solution worked for you!