Question: I have GIT setup for my website, wherein i have 3 branches (development, staging, master). Development has already some changes ahead from staging and master, now there was an urgent requirement for a bug fix.

I checked out a separate branch from development, and committed changes for the urgent fix in it

Now when i try to merge this new branch into staging, it shows me all prior changes too, instead of the showing changes which i just now committed to this branch. 

Can anyone tell me how shall i create a branch which does not show other development branch changes while merging to staging.

Answer: 
You are accessing your MemoryStream after you close it

```
ms.Close();
byte[] buffer = ms.GetBuffer();

```

Also, if an Exception is ever thrown, you will not clean up resources. Make use of the `using` keyword for everything that implements IDisposable.

You need to rewind the memory stream after writing to it and before saving it out

```
ms.Seek(0, SeekOrigin.Begin);

```
It is save memory

```
MemoryStream ms = new MemoryStream();
pictureBox_ad_cam_in.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
kanvert = Convert.ToBase64String(ms.ToArray());

```